Hi,
I have the following code:
{-# LANGUAGE TypeSynonymInstances #-}
data Vect k b = V [(k,b)]
-- vector space over field k with basis b
-- for example, V [(5, E 1), (7, E 2)] would represent the vector 5 e1 + 7 e2
data Monomial v = M [(v,Int)]
-- monomials over variables v
-- for example, M
Maybe -XLiberalTypeSynonyms is an option:
http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/data-type-extensions.html#type-synonyms
On 29 September 2010 20:08, DavidA polyom...@f2s.com wrote:
Hi,
I have the following code:
{-# LANGUAGE TypeSynonymInstances #-}
data Vect k b = V
On Wed, Sep 29, 2010 at 11:08 AM, DavidA polyom...@f2s.com wrote:
Hi,
I have the following code:
{-# LANGUAGE TypeSynonymInstances #-}
data Vect k b = V [(k,b)]
-- vector space over field k with basis b
-- for example, V [(5, E 1), (7, E 2)] would represent the vector 5 e1 + 7 e2
data
On 29 September 2010 20:48, Ryan Ingram ryani.s...@gmail.com wrote:
But it doesn't let you partially apply the type synonym.
On the other hand, if you did this:
newtype Compose f g a = O { unO :: f (g a) }
type Poly k = Compose (Vect k) Monomial
instance Monad (Poly k) where ...
would
On Wednesday 29 September 2010 2:52:21 pm Christopher Done wrote:
LiberalTypeSynonyms lets you partially apply type synonyms.
Not in general. LiberalTypeSynonyms only allows synonyms to be partially
applied when expansions of other type synonyms will eventually cause them to
become fully