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

fmap fmap fmap

Name: Anonymous 2009-02-28 16:41

Someone in #haskell used (***), and when I asked lambdabot to tell me its type, it printed out scary gobbledygook that didn't even fit on one line! Then someone used fmap fmap fmap and my brain exploded.
- from a book on haskell

I think /prog must unite its forces and remake apply into fap (Functional APplication). Really.

Name: Anonymous 2009-03-02 1:24

>>27
With type declarations, if you must. All type information is sorted out at compile time, never at runtime. If you have a type declaration with several constructors (such as data Either a b = Left a | Right b) you can pattern match at runtime to extract the contents:
case q of
    Left x -> "omg hax"
    Right x -> "GRUNNUR"

But remember, just because it's statically typed doesn't mean you have to declare the types. Usually you can just sit back and let type inference do its thing.

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