Ide Haskell For Mac



There is also now the Mac OS X Strike Force that aims to improve using Haskell on OS X.

  • 3GHC
  • 6Editors with Haskell support

Haskell for Mac is an easy-to-use innovative programming environment for the programming language Haskell. It is ideal to learn Haskell and functional programming. It is also great to prototype and experiment with Haskell code. Emacs, Emacs+haskell-mode, and Visual Studio Code are probably your best bets out of the 10 options considered. 'Keyboard-focused, mouse-free editing' is the primary reason people pick Emacs over the competition. This page is powered by a knowledgeable community that. See full list on wiki.haskell.org.

The Haskell Platform

There are Mac OS X installers of the full Haskell Platform development environment. We recommend it:

Haskell for Mac (IDE)

Haskell for Mac is an easy-to-use integrated programming environment for Haskell on OS X. It is a one-click install of a complete Haskell system, including Haskell compiler, editor, many libraries, and a novel form of interactive Haskell playgrounds. Haskell playgrounds support exploration and experimentation with code. They are convenient to learn functional programming, prototype Haskell code, interactively visualize data, and to create interactive animations.

Haskell

Features include the following:

  • Built-in Haskell editor with customisable themes, or you can use a separate text editor.
  • Interactive Haskell playgrounds evaluate your code as you type.
  • Easy to explore type information and to observe the behaviour of you program as you change it.
  • Playground results can be text or images produced by the Rasterific, Diagrams, and Chart packages.
  • Add code and multimedia files to a Haskell project with drag'n'drop.
  • Haskell binding to Apple's 2D animation and games framework SpriteKit.
  • Autosaving and automatic project versioning.

Haskell for Mac supports OS X Yosemite or above.

GHC

Important notes

To get the most out of your GHC environment, you should add '~/Library/Haskell/bin' to your PATH environment variable before the path where you have GHC installed. This will allow you to get and use cabal-updates, as well as other programs shipped with GHC like hsc2hs.

In your ~/.profile, add the line:

export PATH=$HOME/Library/Haskell/bin:$PATH

Mac OS X 10.9 (Mavericks), Mac OS X 10.8 (Mountain Lion) and Xcode 5

Both Mountain Lion and Mavericks support and now use XCode 5, which no longer provides GCC, only Clang.

The workaround that the Haskell Platform maintainers are supporting can be found here. That work around along with this one work with only the system provided compilers.

However, if you are still encountering usual bugs, the GCC based directions here may work out better.

Mac OS X 10.5 (Leopard)

To install GHC on Mac OS X 10.5 (Leopard), there are the following options:

  • install the Haskell Platform
  • install MacPort's ghc package

Ide Haskell For Mac Os

Mac OS X 10.6 (Snow Leopard) and 10.7 (Lion)

Cached
  • Install the Haskell Platform

To uninstall ghc call:sudo uninstall-hs

Xcode 4.1

GHC needs Xcode to be installed so it has access to the bintools, headers, and link libraries of the platform. The later two are provided by the SDK that comes as part of Xcode. GHC 7.0.2 is compiled against the 10.5 SDK. Xcode 4.1 no longer ships with it. ghci will work, but linking and some compiles with <ghc> will not. To make those work you need a copy of the 10.5 SDK. You can get this one several ways:

  • Before you install Xcode 4.1, if you have Xcode 3.2 installed, do one of the following:
    • Move it aside (renaming /Developer to /Xcode3.2)
    • Move just the sdk aside (moving /Developer/SDKs/MacOSX10.5.sdk to, say, /ExtraSDKs/MacOSX10.5.sdk)
    • Move just the sdk aside, install Xcode 4.1, then move it back into the /Developer/SDKs directory.
  • If you don't have Xcode 3.2, then you can download it from the Apple Developer site, and install it in a location other than '/Developer'. If you have already installed Xcode 4.1 be sure that you customized the install and don't install the 'System Tools' or 'UNIX Development' packages.

Building via GHC:

Building via cabal:

Replace {loc} with wherever you put the SDK.

HUGS

  • install MacPort's hugs98 package.


Installing libraries with external C bindings

Haskell libraries are installed with the cabal command line tool.

Some libraries depend on external C libraries, which are best installed with MacPorts. However, you have to tell cabal to include the /opt/local/ directories when searching for external libraries. The following shell script does that by wrapping the cabal utility

Results from the State of Haskell, 2011 Survey.

Editors with Haskell support

Open Source

  • AquaMacs or EmacsForOSX, a graphical Emacs version
  • Eclipse with the EclipseFP plugin. See EclipseOn_Mac_OS_X
  • Emacs, is installed on every Mac
  • MacVim, a graphical Vim version
  • Textmate 2, open source incarnation of TextMate 1.
  • Vim, is installed on every Mac
  • Yi (written in Haskell itself!), is available through cabal-install

Leksah - Haskell IDE In Haskell

Commercial

SubEthaEdit:

TextMate:

Smultron:

and Sublime Text 2:

TextEdit is Mac's default text editor, a very basic editor that works fine for most uses, you must however be careful to put it into plain text mode using the Format menu.

Shipping Installable Haskell Applications

  • mkbndl builds installable Mac OSX applications from your Haskell project.

Links

  • Using Haskell in an Xcode Cocoa project; a description of how to add a Haskell module (callable from C) to an Xcode/Cocoa/Interface builder project on your Mac.
  • Mac OS X Common Installation Paths: an effort to standardize where things go on a Mac OS X installation
Retrieved from 'https://wiki.haskell.org/index.php?title=Mac_OS_X&oldid=60586'

16 comments

  • The IDE has great potential, and I've used it extensively for sandboxed and mini projects, but it's still not mature enough to replace any of the editors I'm already using (and I think they know that over at HfM).

    I'm definitely keeping an eye on it, and once they come up with better pre-existing project support, and possibly git integration, it will most definitely be a candidate for replacing atom or Emacs for me. The feel of it is just fantastic.

    • indy 1071 days ago

      Out of curiosity, did you use the Intero package with Emacs? (https://commercialhaskell.github.io/intero/).

      • chowells 1070 days ago

        Also consider Dante https://github.com/jyp/dante instead of Intero. Similar (not identical, see the README for a quick overview) feature set, doesn't require stack.

      • I haven't, but I'll definitely give it a look!

  • Funny that this would pop up, I just found it and bought it last week! I've been playing with Haskell recently and this app is perfect for playing with example code that you'll read in articles and books while learning.

    Another awesome resource is Hoogle https://www.haskell.org/hoogle/It's super handy if you already have programming experience and are looking for a function that does a particular thing but you don't know what it's called. You can just put the type signature of what you want in the search box and it gives you back functions that'll do it!

    • runeks 1071 days ago

      > Another awesome resource is Hoogle https://www.haskell.org/hoogle/ It's super handy if you already have programming experience and are looking for a function that does a particular thing but you don't know what it's called.

      Agreed. There's also Stackage's Hoogle, which will search through a ton of libraries as well (e.g. aeson, for JSON parsing): https://www.stackage.org/lts-7.24/hoogle

    • re. Hoogle, also check out Hayoo http://hayoo.fh-wedel.de/ which adds a couple of nice features like typeahead & a 'view source' button.

  • The code examples in the five screenshots on the homepage are some of the first real-world use cases I've seen of 'real' Haskell. It gives the impression of Haskell as a practical language other than an idealized clean-room experiment, so kudos to whoever wrote those!

    • signal11 1070 days ago

      IIRC Haskell for Mac was created by @tacticalgrace who's an Australian CS professor: http://www.cse.unsw.edu.au/~chak/

      No idea if he created the demos though.

  • This looks awesome. On Friday I started going through 'learn you a Haskell' and absolutely love the languages expressiveness and syntax.

    One thing that ticked me off a bit was that the package manager and build system (cabal and stack) were a bit incomprehensible to me, hopefully this packages everything up nicely.

    Indentation is a bit confusing in Haskell too, but this IDE has built in support for linting indentation.

    • adamnemecek 1071 days ago
      • I tried out Yesod and Snap a while back and while the frameworks themselves were pleasant to work with from what I could tell, I spent whole days messing with package management issues that would render my projects unrunnable after new installs. I couldn't see myself working with Haskell in production for a web project until that situation improves.

        • zzzzzzzza 1071 days ago

          Funny I do web dev, mostly haskell and javascript and feel like haskell is a solid rock and javascript is unbearable.

          Part of the explanation may be ease of initial interchangeability (javascript: oh yeah we can glue that to this no problem, it's all just like json or whatever man) versus maintainability (haskell: here is your type contract, the closest thing you can get in code to the fundamentalness and immutability of 2+2 =4).

        • Aren't some Haskell developers also using Nix for dependency management?

          • tikhonj 1071 days ago

            I use Nix and it's awesome, but still in early adopter territory. It works wonderfully if you really value reproducible builds and are willing to put some effort in the initial setup, but it's still a bit fiddly and documentation is nearly non-existent. If you have the time and motivation to learn about it up-front and get it set up it pays off, but I wouldn't recommend it to beginners just trying to learn Haskell.

        • How long is a while back?

          • 3131s 1071 days ago

            A couple months ago. I'll definitely give them another shot, but it was very non-exotic stuff like installing snaplet-postgresql-simple that sent two separate systems into dependency hell.

            • platz 1071 days ago

              That's pretty recent.

              I'm sure you're aware of stack , solves most 'dependency hell' issues. I'm not sure how much snap is maintained these days BTW, but definitely yesod is actively maintained and should have no dep issues there especially if using stack

              • jfoutz 1070 days ago

                My limited understanding is if I require a package ‘A’ and another package ‘B’ it’s fine. Unless ‘A’ depends on a different ‘B’. Then I’m pretty much fucked.

                • platz 1070 days ago
      • Buttons840 1071 days ago

        Stack is the easier of the two, that may change with future cabal-install releases. Probably the hardest part is getting the cabal file setup correctly.

        • beojan 1071 days ago

          Start with a stack template. For an application, the simple template is the easiest.

          • adamnemecek 1071 days ago

            I’m not talking about authoring, I’m talking about including projects with stack. Idk if it ever worked without me spending at least 15 mind on it.

            • beojan 1070 days ago

              If you pick a stackage release that has all the packages you need, it's as simple as adding the package to your dependencies in the cabal file.

              If your stackage release doesn't have the package you need, you also need to add it to `extra-deps` in stack.yaml.

  • I really like that it has SpriteKit integration but there are more practical, work-a-day framework bindings that would have sold me. The ideal world a Haskell IDE for Mac inspires is one in which I can build native macOS applications in Haskell. I hope it's on the radar.

  • > Haskell for Mac integrates Apple’s SpriteKit game engine including animations & physics.

    Interesting. How is this done? Is there a Haskell-style interface provided, or is it a thin veneer over the Objective-C API?

    • jfoutz 1071 days ago
  • I use IntelliJ IDEA with the intellij-haskell plugin, which works to some extent, but is fairly slow -- not the least at startup, which can easily take five minutes.

    I'm afraid I won't be trying out this IDE, however, unless they offer a trial period (which I can't spot anywhere on the page). $30 isn't too much for a good IDE, but I'd like to try it out before paying in full, particularly since it seems to reinvent the IDE from the ground up, which makes me suspect a lot of the extra functionality, that more mature IDEs have, is missing.

    • pthreads 1071 days ago

      At the very bottom they have a link for the trial version (http://store.haskellformac.com/)

    • Yeah, I'm using IntelliJ IDEA with intellij-haskell plugin as well! Works quite nicely, but my work is pretty trivial at the moment, so I'm not sure how it will hold up for something a bit more complicated. We shall see.!

  • Anybody knows some nice IDE on Windows? Or is programming on Windows even worthwhile?

    • icc97 1071 days ago

      I got Haskell + Emacs + Intero working on Windows [0]

      [0]: https://ianchanning.wordpress.com/2016/08/11/installing-hask..

    • I've gotten vscode working well on Windows with the haskero plugin. You'll need to install stack for this to work correctly.

  • I finally updated to OS X Yosemite (10.10) and went to buy this app as I had been intending to once I updated, but unfortunately since I made those plans, Haskell for Mac now requires an even newer version of OS X :( Unfortunate.. I'll have to stick with IntelliJ IDEA for now -- no plans to ever 'upgrade' beyond Yosemite unless absolutely necessary.

    • eicossa 1069 days ago

      Why don't you want to upgrade beyond Yosemite ? I just bought a new Macbook Air and its been nagging me to update.

  • This is just what I needed. I love Vim and Emacs for daily work, but a good IDE is a fantastic learning tool. Looking forward to trying it!

  • I bought this last year. Nice product. I usually use Emaces but the IDE works nicely for small bits of code and live programming.

  • HfM is great to play with and learn Haskell. For a real project, I use Haskell Vim IDE.

  • > Learn Functional Programming with Haskell

    Why would I pay $30? I can learn and use Haskell for $0.

    This feels like a typical mac os thing, pay for everything.

    • aetherspawn 1071 days ago

      You pay for good software, and a lot of Mac OS software is not just good, but great.

      I didn’t bat an eyelid when I bought Little Snitch, Alfred, Parallels, et al. and from the screenshots this looks like a nicely polished piece of software.

      • comment105 1071 days ago

        > You pay for good software

        Hmmm, I don't like that statement.

        'Great software' is very subjective. I think linux is a great piece of software. I use a macbook for the great hardware but certainly not for the software! Apart from Sublime text all apps I use are free, including hundreds of CLI apps.

        • jernfrost 1071 days ago

          Sounds more like a religious belief than something which could be argued on merit. I use both Linux and macOS on a daily basis and there is just no question about which OS has the highest quality software eco system.

          I like Unix, which is why I use Linux and macOS. Linux because macOS is not an option and work, and I dislike non Unix systems like Windows. I like to have access to a powerful CLI.

          But lets face it. Once you step outside the CLI on Linux, it compares very poorly to macOS. Not only do you have far more choices for every type of app but most of those choices tend to be higher quality as well.

          Now let me qualify what I mean by quality. Many Linux apps does in fact have a significant amount of functionality. You got quite extensive packages such as Gimp and Inkwell. However these frequently have poorly designed UIs or UIs which are completely different from other applications, and frequently integrate poorly with the rest of the OS.

          You mentioned Sublime. Well guess what that came directly as a reaction to TextMate on macOS. There are dozens of these types of modern incarnations of vim and emacs on Mac. Fortunately now we have started getting some selection on Linux with sublime and atom. But it was kind of slow, and while both have quite good core functionality, they are a bit lacking in UI. You notice how a lot of successful apps on Linux have to rely on HTML based interfaces. Which means you kind of notice the UI is kind of slim. Last time I checked neither Sublime and Atom had any real UI for creating and modifying bundles/plugins.

        • Apart from Sublime text

          So some software is worth paying for, we're just arguing over which?

    • >Why would I pay $30?

      If you think the benefit of using the software is $30 or greater, like anything else in the world.

  • i know this is a haskell thread but after trying to grok haskell for years (yes i understand monads) i've discovered F# and jesus christ what a dramatic difference in functional language ergonomics and tooling and ecosystem. it has everything that haskell does (ADTs, type inference, immutability [when you want it], lazy [or eager] eval, pattern matching/destructuring, expression based, and partial application/curried functions) but it doesn't handcuff you to pure (side-effect free) code. say what you want but often writing code in haskell is monad acrobatics because you can't write a simple for loop or do i/o. the tooling is fantastic and cross platform (visual studio/xamarin) with a real debugger, real breakpoints, lightyears better docs, readable compiler errors, enormous ecosystem by way of interop with c# libraries. it's an eminently practical functional language. the `F# for fun and profit` series of blogposts is fantastic for not only introducing the language but explaining the value proposition of functional patterns. of course i wish ocaml had the same advantages (and it does have many) since it compiles to native binary but i'll accept the CLI in exchange for all the tooling benefits.

    • bad_user 1071 days ago

      On Hacker News I've noticed people read titles, then go to the comments section to dump whatever thought is on their minds, triggered by certain keywords like some game I used to play as a child, as an excuse to get something off their chest.

      It's very rude to pimp on other people's projects and articles to get something off your chest though.

      This article is not primarily about Haskell, but about a commercial IDE made by a guy named Manuel M T Chakravarty — which for me it's interesting, because it's an example of somebody that apparently makes something that he likes, helping an ecosystem and people give him money for it. So it's perfectly on topic for Hacker News and visitors of the comments section like myself, would like to see opinions related to this project.

      As for the comment, F# is a fine language, but reading the comparison I'm fairly certain that you haven't learned Haskell and I say this in order to help you — learning Haskell is the easiest path to practicing FP, which given your comment I'm fairly certain you don't grok yet, which keeps you back from being a good F# developer as well.

      That you haven't learned Haskell is more of a failure of Haskell's community — but there have been recent projects trying to address that. One is the Haskell for Mac project here in TFA, others are the Stack build tool and http://haskellbook.com, a really good book meant for beginners.

      • mlevental 1071 days ago

        >It's very rude to pimp on other people's projects and articles to get something off your chest though.

        this isn't a refereed journal - you can't prescribe how people engage with the material. i was prompted to post what i did on the back of having experimented with every ide-ish thing for haskell out there about 6 months ago (this one included).

        >As for the comment, F# is a fine language, but reading the comparison I'm fairly certain that you haven't learned Haskell and I say this in order to help you

        not only is this patronizing but it commits the fallacy of begging the question - i did learn haskell while working on a fairly sizable codebase at my last job. i won't reiterate all of my complaints here (i've posted several times to r/haskell) but the tooling sucks and pure code is a set of handcuffs - golden handcuffs maybe but handcuffs nonetheless. that we disagree on whether pure code is the one true god does not mean i don't understand fp - it means just that, that i disagree! to conclude from my disagreement with you that i don't understand fp begs the question (petitio principii) of whether pure code is the one true god.

        >That you haven't learned Haskell is more of a failure of Haskell's community — but there have been recent projects trying to address that. One is the Haskell for Mac project here in TFA, others are the Stack build tool and http://haskellbook.com, a really good book meant for beginners.

        i read the haskell book and learnyouahaskell and real world haskell and many many tutorials and wrestled with stack and cabal. certainly they're better than the tools/resources available for e.g. cobol but they do not compare to the ecosystem around other, much more welcoming languages.

        • axlprose 1071 days ago

          I think part of the issue that the parent comment was trying to get at here, is that haskell does things the way it does for a reason, and that the type system is much more of an aid to thinking about the problem you're solving than some restrictive handcuff, once you understand what it's doing and why it's doing it. I say this as someone who worked in F# for years, and eventually switched to haskell because it had better support for these concepts via it's built-in typeclasses.

          As for what you say about haskell being 'monad acrobatics', it can be equally true of F#, or any other typed functional language, because all monads/applicatives/functors/etc are, are just helpful functional design patterns. It would be like calling Factories in Java handcuffs. If you don't want to code using Factories or Monads in Java/Haskell, that's still your choice, but if a lot of libraries in that language are using that pattern, it's probably for a reason that makes it useful in that language's paradigm. Haskell just makes it easier to use these patterns than F#/OCaml/Elm/etc because of its typeclasses, so a lot more people use them. That's all there is to it. I'll grant you that F#'s tooling is a little bit better in places though, but I was never a huge fan of it's project/module system. OCaml probably has both F# and Haskell beat there.

          That being said, F# is still a fine language, and I think it's probably a better stepping stone towards learning haskell (and typed functional programming in general) than haskell itself, just because it gives you the option of gradually easing your way into the ML style of programming if you've already had some imperative programming experience before. And that's key, because the issue here is one of shifting the way you think about your programming problems, and there's simply no quick/easy way to do that. In fact, I find that a lot a complete newcomers to programming have an easier time learning how to do things the haskell way, because they don't really have these issues of feeling restricted by the type system, since it's the only way they've been taught to do things.

          So overall I would say just keep at it with F#, and check out the F# way of doing things like monads (or 'computation expressions' [0] as they're called in F#) , monoids [1], 'Railway Oriented Programming' [2], and other such patterns [3], then maybe try checking out Haskell again later and see if it seems a little easier. But there's really no reason to be bashing it regardless.

          [0] https://fsharpforfunandprofit.com/series/computation-express..

          [1] https://fsharpforfunandprofit.com/posts/monoids-without-tear..

          [2] https://fsharpforfunandprofit.com/rop/

          [3] https://fsharpforfunandprofit.com/series/map-and-bind-and-ap..

      • > Haskell is the easiest path to practicing FP

        Have to disagree here. Haskell is good for learning about advanced type systems along with FP. Office for mac download product key.

        But for the 'easiest' path to just learning FP, Scheme, SML, even Clojure are far more approachable.

      • sriku 1070 days ago

        > a commercial IDE made by a guy named Manuel M T Chakravarty

        He's not just 'a guy'. Check out http://www.cse.unsw.edu.au/~chak/papers/ . He's an old timer in the field.

      • > helping an ecosystem

        If it were open source, yeah definitely. But is this app written entirely in Haskell? I don't think so, otherwise it would at least be a good Haskell promotion.

    • > you can't write a simple for loop or do i/o.

      You can often use the 'for' function for things analogous to effectful imperative loops. http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-T..

    • > you can't write a simple for loop or do i/o

      Trivially refuted.

    • If you think writing code in haskell is monad acrobatics, you don’t grok monads.

      • mlevental 1071 days ago

        alternatively if you think writing haskell isn't monad acrobatics then you haven't written i/o heavy code.

        • kccqzy 1071 days ago

          I’ve written 60,000+ lines of Haskell, some of which are fairly I/O heavy with low-level FFI, raw and unsafe pointer manipulation, etc. I/O heavy code looks just like any other imperative language: you do this, perhaps extract a result, then do that.

          In contrast in pure code people have more tendency to get into monad acrobatics, but excessive monad acrobatics is just code smell.

        • I’ve written more than 40,000 lines of I/O heavy code. I had a phase where I felt this way, but really it is a learning issue and you get passed it.

          • jernfrost 1071 days ago

            See that is why I eventually decided against Haskell. There are just too few Haskell jobs so investing that amount of time from a career perspective makes little sense. That leaves hobby projects. And it just does not seem to make sense to me to spend that much time on a hobby, when you got plenty of other powerful languages you can learn in a fraction of the time and do more useful stuff with.

            As an academic project language it seems great, but for practical work I just don't see it.

            I can do a fair amount of functional programming in Swift and Julia, but still make useful stuff without without an huge mental investment.

            My life as a professional C++ programmer has made me very negative to anything involving unreasonable complexity.

            • jeremyjh 1071 days ago

              I agree with you. I don't regret the time I invested in Haskell but the payoff isn't obvious. C++ is a very different kind of complexity though, it is so easy to get burned by something that compiles but fails at run-time or is very inefficient due to an issue you didn't know you didn't understand. The Haskell compiler may make you want to throw your computer through a window but you won't think everything is fine when its not.

            • I've found it quite practical for getting things done, there's a higher learning curve then something like python though. From a career perspective it's hard to recommend anything that isn't one of the top most used programming languages, I'm not sure Haskell or most functional programming languages can do anything about that though.

          • > but really it is a learning issue and you get passed it.

            No wonder, all this time I've been thinking that with enough practice I'll finally grok monads, but no, one simply has to wait for the pass to be on target.

            SPJ, hit me in the numbers!

          • Any good open source examples of I/O heavy Haskell code?

            I'm a rank beginner at Haskell, understand the very basics, but still feel handcuffed when I stray away from the textbook examples.

            • jose_zap 1071 days ago

              Here’s a relatively simple example of a CLI tool that is very IO heavy https://github.com/seatgeek/docker-build-cacher

              • sokoloff 1070 days ago
        • axlprose 1071 days ago

          It doesn't even necessarily have to be IO heavy, just Functor and Monad heavy. But even that is reasonable to deal with just using traverse/sequence, fold, and fmap usually.

      • And if you think monad transformers are the answer to anything, maybe you should let go of your books and try some real problems for a change. I spent several years digging into Haskell; but in the end I couldn't shake the feeling that it's more about mental masturbation than practical problem solving, which is fine if that's what you're looking for. Even the poster child feature of GHC, Software Transactional Memory; is barely usable outside of neat tricks and toy problems.