Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
KaneTW
Dec 2, 2011

Yay! A FP thread.

http://www.seas.upenn.edu/~cis194/spring13/lectures.html is probably the best Haskell beginner resource (probably above books) (I can't really recommend LYAH, but RWH is good (but not as good as CIS194)).

https://github.com/bitemyapp/learnhaskell should be in the OP too.

Adbot
ADBOT LOVES YOU

KaneTW
Dec 2, 2011

When you update GHC it creates a new cabal tree for the new version. You'll have to reinstall what you need and recompile existing binaries if they depend on runtime linking like Xmonad. I usually keep the old version around for a while.

KaneTW
Dec 2, 2011

https://github.com/bitemyapp/learnhaskell

KaneTW
Dec 2, 2011

I can't think of anything better than
code:
instance Show Day where
  show Mon = "Monday"
   ...
. The solution using indexing is rather ugly and not really Haskelly.

I wouldn't derive Enum because
code:
> succ Sun
*** Exception: succ{Day}: tried to take `succ' of last tag in enumeration
makes no sense.

KaneTW
Dec 2, 2011

GHC 8.0 release candidate is around the corner, including cool stuff like -XTypeInType (blog post about it), Strict Haskell, Duplicate Record Fields (allows you to have record field names where the ambiguity is resolved during typechecking) and a whole lot of other stuff.

KaneTW
Dec 2, 2011

Visible type application might make it into GHC 8.0, allowing you to write things like
code:
:t length
length :: Foldable t => t a -> Int
:t length @[]
length :: [a] -> Int
or a more useful example,
code:
:t read
read :: Read a => String -> a
:t read @Int
read :: String -> Int
This is especially nice whenever you used to need a proxy type or similar to disambiguate typevars.

KaneTW
Dec 2, 2011

What GHC does is rename the type variables so things like that Elm error are obvious.
code:
module Error where

const' :: a -> b -> b
const' _ x = x'
  where
    x' :: b
    x' = x
code:
Error.hs:7:10: error:
    • Couldn't match expected type ‘b1’ with actual type ‘b’
      ‘b’ is a rigid type variable bound by
        the type signature for:
          const' :: forall a b. a -> b -> b
        at Error.hs:3:11
      ‘b1’ is a rigid type variable bound by
        the type signature for:
          x' :: forall b1. b1
        at Error.hs:6:11
    • In the expression: x
      In an equation for ‘x'’: x' = x
    • Relevant bindings include
        x' :: b1 (bound at Error.hs:7:5)
        x :: b (bound at Error.hs:4:10)
        const' :: a -> b -> b (bound at Error.hs:4:1)

KaneTW
Dec 2, 2011

It's a good book. Certainly way better than the books I used when I learned Haskell.

KaneTW
Dec 2, 2011

That buildwrapper error seems like a bug in the module or its version bounds. Building stuff with C libraries is a gigantic pain on Windows.

Leksah starts and editing works fine, but I can't get it to (didn't bother too much) actually build packages, so I just keep a MSYS shell open and build with stack.

http://darcs.net/Windows has steps on how to build libcurl bindings and you adapt those for zlib/cairo, but honestly it's not worth the trouble. Boot up a Linux VM and call it a day.

Alternatively, you can try getting Emacs or something to work. Probably better chance since you can build ghc-mod etc. easily on Windows.

Adbot
ADBOT LOVES YOU

KaneTW
Dec 2, 2011

"lucky is a function from any Integral type to String" sounds good to me. Maybe "from any type that's an instance of Integral to String" but while a bit more accurate it's also a mouthful

  • Locked thread