Skip to main content

Home/ Haskell/ Group items tagged questions

Rss Feed Group items tagged

Javier Neira

What is (functional) reactive programming? - Stack Overflow - 0 views

  • Semantically, FRP's concurrency is fine-grained, determinate, and continuous.
  • Dynamic/evolving values (i.e., values "over time") are first class values in themselves. You can define them and combine them, pass them into & out of functions. I called these things "behaviors".
  • Each occurrence has an associated time and value.
  • ...3 more annotations...
  • In software design, I always ask the same question: "what does it mean?".
  • It's been quite a challenge to implement this model correctly and efficiently, but that's another story.
  • The basic idea behind reactive programming is that there are certain datatypes that represent a value "over time". Computations that involve these changing-over-time values will themselves have values that change over time.
Javier Neira

99 questions/1 to 10 - HaskellWiki - 0 views

  • data NestedList a = Elem a | List [NestedList a]   flatten :: NestedList a -> [a] flatten (Elem x) = [x] flatten (List x) = concatMap flatten x
  • compress :: Eq a => [a] -> [a] compress = map head . group We simply group equal values together (group), then take the head of each. Note that (with GHC) we must give an explicit type to compress otherwise we get:
1 - 5 of 5
Showing 20 items per page