Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ advice series: Haskell

Name: Anonymous 2008-07-18 0:23

Dear /prog/,

I'm tired of fighting with ENTERPRISE languages. I want to learn Haskell. The question is, where do I start?

I'm not completely ignorant of programming language theory -- I read http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=8184 several years ago -- but the math is a bit rusty. I've tried a few Haskell ``introductions'' but they were more philosophical wanking about the beauty of monads and other abstract bullshite than an instruction on how to program in Haskell. In short, help.

Name: Anonymous 2008-07-18 12:25

>>20
It's slightly better, but still sexual harassment.

GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> let addNeg = (0-) . (+)

<interactive>:1:13:
    No instance for (Num (a -> a))
      arising from a use of `-' at <interactive>:1:13-16
    Possible fix: add an instance declaration for (Num (a -> a))
    In the first argument of `(.)', namely `(0 -)'
    In the expression: (0 -) . (+)
    In the definition of `addNeg': addNeg = (0 -) . (+)
Prelude> let addNeg = (0-) `((.).(.))` (+)
<interactive>:1:19: parse error on input `('
Prelude> let addNeg = ((.).(.)) (0-) (+)
Prelude> let compose x = foldl (.) ($) $ replicate x (.)

<interactive>:1:44:
    Occurs check: cannot construct the infinite type: a = a1 -> a
    Probable cause: `.' is applied to too few arguments
    In the second argument of `replicate', namely `(.)'
    In the second argument of `($)', namely `replicate x (.)'
Prelude>

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List