srhb 2017-02-20 20:45:24
(I'm trying to carve off all the irrelevancies wrt. the type)
srhb 2017-02-20 20:45:48
:t fmap (maybe Nothing read) Nothing
lambdabot 2017-02-20 20:45:51
Read a => Maybe (Maybe a)
srhb 2017-02-20 20:46:13
:t fmap (maybe (Just "foo") read) Nothing
lambdabot 2017-02-20 20:46:15
Maybe (Maybe [Char])
srhb 2017-02-20 20:46:27
Hope that helps a bit. It's a good technique, by the way/
spatial 2017-02-20 21:07:05
Is there a gentle introduction reactive programming in haskell ?
spatial 2017-02-20 21:07:59
Mine is a simple board game. 2 players playing.
spatial 2017-02-20 21:08:34
A GUI shows the progress. Is that reactive ?
geekosaur 2017-02-20 21:13:11
reactive isn't so much how the game works, as how you implement the logic
geekosaur 2017-02-20 21:13:51
you can think of it as a style of event driven programming
tdammers 2017-02-20 21:16:15
it's a bit of a fuzzy term really, because implementation details vary a lot, but IMO the core idea of reactive programming is that you model your application logic in terms of immutable state objects, transitions between them, and some sort of event mechanism to close the cycle
jnj 2017-02-20 21:36:27
Hi. I have a function x ocurring both as "x" and "x.\" in the profiling report. What does the ".\" part mean?
jle` 2017-02-20 21:37:17
jnj: '\' refers to anonymous functions/lambdas
jle` 2017-02-20 21:37:23
so x.\ is a lambda inside x
spatial 2017-02-20 21:37:49
Let's say I have a board game. And a GUI. What is the functional pattern that transforms and updates from one to the other ?
jnj 2017-02-20 21:38:27
jle`: thank you
jle` 2017-02-20 21:38:33
no problem!
srhb 2017-02-20 21:39:27
spatial: FRP is all the rage these days.
spatial 2017-02-20 21:41:45
Functional Reactive programming ?
osa1 2017-02-20 21:41:46
spatial: update your state, recurse using updated state
sm 2017-02-20 21:42:17
spatial: the GPIH book (Game Programming in Haskell) is a nice intro
spatial 2017-02-20 21:43:10
osal: Yes. Done it with OCaml. But as I am new I was looking for a functional way.
spatial 2017-02-20 21:43:17
in Haskell
osa1 2017-02-20 21:43:40
spatial: that's a functional way
osa1 2017-02-20 21:44:37
spatial: I don't mean in-place update, I mean functional update, as in updates in persistent data structures
spatial 2017-02-20 21:45:06
osal: How do I transform between a list and a screen co-ordinate system ?