Hi Joachim,
that's right thanks, but I was looking for a way to do that from a program.
ghc-pkg does not seems to expose any library...
On Wed, Mar 20, 2013 at 11:23 PM, Joachim Breitner m...@joachim-breitner.de
wrote:
Hi,
Am Mittwoch, den 20.03.2013, 00:34 +0100 schrieb Corentin Dupont:
On 21 March 2013 19:52, Corentin Dupont corentin.dup...@gmail.com wrote:
Hi Joachim,
that's right thanks, but I was looking for a way to do that from a program.
ghc-pkg does not seems to expose any library...
I'm playing with tagless final interpreters reading [1], using a very simple
language:
class Ints repr where
int :: Integer - repr Integer
(.+.) :: repr Integer - repr Integer - repr Integer
(.*.) :: repr Integer - repr Integer - repr Integer
(.-.) :: repr Integer - repr
Hi,
I have a situation where I need to define a data type T such that
data T = C1 Int | C2 Char | C3 T
However, I want to enforce a constraint that C3 only allows (C2 Char) and
not (C1 Int). That is
x = C3 (C1 10) -- should not compile - but my above definition will let it
compile
I was
You could use a GADT:
{-# LANGUAGE GADTs #-}
data T a where
C1 :: Int - T Int
C2 :: Char - T Char
C3 :: T Char - T Char
This will allow you to put a C3 in a C3. If you want to prevent that,
just invent some other index, something like:
{-# LANGUAGE GADTs, EmptyDataDecls #-}
data Yes
On 13-03-21 06:32 AM, matteo vezzola wrote:
I'm playing with tagless final interpreters reading [1], using a very simple
language:
class Ints repr where
int :: Integer - repr Integer
(.+.) :: repr Integer - repr Integer - repr Integer
(.*.) :: repr Integer - repr Integer - repr
On Thu, Mar 21, 2013 at 11:32:21AM +0100, matteo vezzola wrote:
I'm playing with tagless final interpreters reading [1], using a very simple
language:
class Ints repr where
int :: Integer - repr Integer
(.+.) :: repr Integer - repr Integer - repr Integer
(.*.) :: repr
On Thu, Mar 21, 2013 at 06:18:46PM +0530, C K Kashyap wrote:
Hi,
I have a situation where I need to define a data type T such that
data T = C1 Int | C2 Char | C3 T
However, I want to enforce a constraint that C3 only allows (C2 Char) and
not (C1 Int). That is
If C3 should only be able
[Apologies if you receive multiple copies of this CFP]
===
2nd CALL FOR PAPERS
17th BRAZILIAN SYMPOSIUM ON PROGRAMMING LANGUAGES
Brasília, Distrito Federal, Brazil
September 29th to October 4th, 2013
http://cbsoft2013.cic.unb.br/sblp
-- bytestring-lexing 0.4.3
The bytestring-lexing package offers efficient reading and packing of
common types like Double and Integral types.
-- Changes (since
The new package monoid-subclasses [1] exports a number of classes
that sit between monoids and groups: ReductiveMonoid,
CancellativeMonoid, GCDMonoid, MonoidNull, and FactorialMonoid among
others. The package also comes with class instances for all applicable
data types from base, vector,
11 matches
Mail list logo