Yitzchak Gale wrote:
Eric Mertens wrote:
(but I've had my head in Agda lately)
Indeed, coming across this problem tempted me
to abandon the real world and take refuge in Agda.
http://hpaste.org/44469/software_stack_puzzle
Wow, so simple, and no higher-rank types! This is the
best solution
Yves Parès wrote:
Okay thanks I got the difference between both.
The 'exists' syntax seems very useful. Is it planned to be added to GHC in a
near future?
Probably not. But once GADTs become more prominent, there might be
pressure to add first-class existential types to the language.
Note
There were a number of emails discussing what a type-safe list solution
would like look. This was the approach that first came to mind when I read
your email (but I've had my head in Agda lately)
http://hpaste.org/44469/software_stack_puzzle
I've written up a minimal working example of this
Brandon Moore wrote:
This code produces and uses a table of all
allowed combinations. I think this makes it easier
to understand why the code works (and is H98).
It's just as easy to make a direct version that
produces one requested composition in linear time,
so I haven't worried whether
Eric Mertens wrote:
(but I've had my head in Agda lately)
Indeed, coming across this problem tempted me
to abandon the real world and take refuge in Agda.
http://hpaste.org/44469/software_stack_puzzle
Wow, so simple, and no higher-rank types! This is the
best solution yet. I am now truly in
From: Yitzchak Gale g...@sefer.org
Brandon Moore wrote:
This code produces and uses a table of all
allowed combinations. I think this makes it easier
to understand why the code works (and is H98).
It's just as easy to make a direct version that
produces one requested composition in
Brandon Moore wrote:
My solution does not serialize and deserialize between every
pair of layers.
Ahhh, I see! Sorry I didn't look closely enough the first time.
Yes, this is a very nice Haskell 98 solution!
This code produces and uses a table of all
allowed combinations. I think this makes
Thanks to everyone for the nice solutions to this puzzle,
here and on reddit:
http://www.reddit.com/r/haskell/comments/fu6el/a_practical_haskell_puzzle/
There were two basic approaches. One was to use GADTs and
higher-rank types to reduce the amount of type trickery needed.
One nice example is
Okay thanks I got the difference between both.
The 'exists' syntax seems very useful. Is it planned to be added to GHC in a
near future?
2011/2/28 Heinrich Apfelmus apfel...@quantentunnel.de
Yves Parès wrote:
takeC :: Int - Compoz a b - (exists c. Compoz a c)
dropC :: Int - Compoz a b -
From: Yitzchak Gale g...@sefer.org
To: haskell-cafe@haskell.org
Cc: Heinrich Apfelmus apfel...@quantentunnel.de; Lennart Augustsson
lennart.augusts...@gmail.com
Sent: Wed, March 2, 2011 9:45:15 AM
Subject: Re: [Haskell-cafe] A practical Haskell puzzle
Thanks to everyone for the nice
Yitzchak Gale wrote:
You have written a large software system in Haskell. Wishing to
play to Haskell's strength, you have structured your system
as a series of composable layers. So you have data types
Layer1, Layer2, ...
and functions
layer2 :: Layer1 - Layer2
layer3 :: Layer2 - Layer3
takeC :: Int - Compoz a b - (exists c. Compoz a c)
dropC :: Int - Compoz a b - (exists c. Compoz c b)
What does 'exists' means? To create a rank-2 type can't you use:
takeC :: Int - Compoz a b - (forall c. Compoz a c)
??
2011/2/28 Heinrich Apfelmus apfel...@quantentunnel.de
Yitzchak Gale
On 2/28/11 6:01 AM, Yves Parès wrote:
takeC :: Int - Compoz a b - (exists c. Compoz a c)
dropC :: Int - Compoz a b - (exists c. Compoz c b)
What does 'exists' means? To create a rank-2 type can't you use:
takeC :: Int - Compoz a b - (forall c. Compoz a c)
??
For any A and T,
On 2/28/11 2:43 AM, Yitzchak Gale wrote:
You have written a large software system in Haskell. Wishing to
play to Haskell's strength, you have structured your system
as a series of composable layers. So you have data types
Layer1, Layer2, ...
and functions
layer2 :: Layer1 - Layer2
layer3 ::
On Mon, Feb 28, 2011 at 12:41 PM, wren ng thornton w...@freegeek.org wrote:
On 2/28/11 2:43 AM, Yitzchak Gale wrote:
You have written a large software system in Haskell. Wishing to
play to Haskell's strength, you have structured your system
as a series of composable layers. So you have data
Yves Parès wrote:
takeC :: Int - Compoz a b - (exists c. Compoz a c)
dropC :: Int - Compoz a b - (exists c. Compoz c b)
What does 'exists' means? To create a rank-2 type can't you use:
takeC :: Int - Compoz a b - (forall c. Compoz a c)
??
Ah, (exists c. Compoz a c) means There exists a
16 matches
Mail list logo