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

/prog/ challenge [HASKELL]

Name: Anonymous 2008-05-09 13:15

Use the loeb function:
loeb :: Functor a => a (a x -> x) -> a x
loeb x = fmap (\a -> a (loeb x)) x


To implement a basic spreadsheet processor. The processor should accept input of the form:
|##|A        |B    |C   |D       |
|01|(* B1 C1)|2    |3   |(* A1 2)|

The output from this example should be:
|##|A      |B    |C   |D     |
|01|6      |2    |3   |12    |

Cells may contain number literals, references to other cells of the form <letter><number>, or function applications of the form (<function> *<args>).

Name: Anonymous 2009-07-02 0:49

>>80
or you could just make it [[a] -> a] -> [a], and most people wouldn't know the difference. because really, who uses loeb with anything else?

Name: Anonymous 2009-07-02 4:23

>>80
[m]s/Functor/Monad/
1s/f/m/g[/code]

Name: Anonymous 2009-07-02 4:32

>>82
    Could not deduce (Functor m) from the context (Monad m)
      arising from a use of `fmap' at <interactive>:1:13-16
    Possible fix:
      add (Functor m) to the context of an expression type signature
    In the first argument of `(.)', namely `fmap'
    In the second argument of `(=<<)', namely `fmap . flip id'
    In the first argument of `fix', namely `(fmap . flip id =<<)'

Name: Anonymous 2009-07-02 5:05

new challenge: write the loeb function in a language that isn't haskell, and use it to do something useful.

Name: Anonymous 2009-07-02 6:03

>>84
Rather than taking five seconds to write it in Clean I'll just point out that you can translate it pretty much verbatim from the Haskell version.

Name: Anonymous 2009-07-02 6:47

>>85
and use it to do something useful.

Name: Anonymous 2009-07-02 11:01

Now implement löbM :: (Traversable f, MonadFix m) => f (f a -> m a) -> m (f a).

Name: Anonymous 2010-12-17 1:29

Xarn is a bad boyfriend

Name: Anonymous 2010-12-20 19:23

Name: Sgt.Kabukimanឪ뵾 2012-05-23 5:39

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

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