A functional programming language

learn more… | top users | synonyms

31
votes
0answers
3k views

Why (or why not) are existential types considered bad practice in functional programming?

What are some techniques I might use to consistently refactor code removing the reliance on existential types? Typically these are used to disqualify undesired constructions of your type as well as to ...
2
votes
0answers
90 views

Why do Haskell functors only have derived types in their target category?

In Haskell, the Functor typeclass functor is defined as follows (see e.g. Haskell wiki): class Functor (f :: * -> *) where fmap :: (a -> b) -> f a -> f b As far as I understand ...
1
vote
0answers
208 views

What is the logic behind the use of different arrows (-> <-) in Haskell?

I've been thinking about language design lately, and reading over some of the new things in Haskell (always a nice source of inspiration). I'm struck by the many odd uses of the left <- and right ...
0
votes
0answers
71 views

Database-like structure in memory

I need a database-like structure that will wrap this: data MsgPackDB = MsgPackDB { dim :: !(V.Vector Int) , rows :: !([DBRow]) } data DBRow = ...
0
votes
0answers
64 views

Is there a way to force evaluation in GHCi?

I'm messing around with binary trees, and I'm trying to get a very rough benchmark of a few functions using GHCi. I only want to get the time required to evaluate the test functions; not how long it ...