Personal tools

Talk:GHC/Type families

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
m (GMapInt or GMAp Int)
 
m (added user name to my last edit...)
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
I believe the instance declaration:
+
How does this change now that GHC 6.8.1 is out? [[User:MathematicalOrchid|MathematicalOrchid]] 12:55, 11 November 2007 (UTC)
   
instance GMapKey Int where
 
data GMap Int v = GMapInt (Data.Map.Map Int v)
 
empty = GMapInt Data.Map.empty
 
lookup k (GMapInt m) = Data.Map.lookup k m
 
insert k v (GMapInt m) = GMapInt (Data.Map.insert k v m)
 
should be:
 
   
instance GMapKey Int where
+
data GMap Int v = GMap Int (Data.Map.Map Int v)
+
In 4.3.2 Examples
empty = GMap Int Data.Map.empty
+
lookup k (GMapInt m) = Data.Map.lookup k m
+
module GMap (GMapKey(..), GMap(..)) where...: As before, but also exports all the data constructors GMapInt, GMapChar, GMapUnit, GMapPair, and GMapUnit.
insert k v (GMapInt m) = GMap Int (Data.Map.insert k v m)
+
  +
should probably be:
  +
  +
module GMap (GMapKey(..), GMap(..)) where...: As before, but also exports all the data constructors GMapInt, GMapChar, GMapUnit, GMapPair, and GMapEither.
  +
  +
  +
Paragraph 6 is a copy of Paragraph 4 except Collects is used.
  +
  +
  +
In 7.3 Equality constraints
  +
  +
Why was `<hask>~</hask>' used, instead of `<hask>=</hask>` ?
  +
[[User:StefanLjungstrand|StefanLjungstrand]] 19:55, 12 December 2007 (UTC)
  +
  +
== GADT syntax in Type Families ==
  +
  +
GADT syntax is allowed nowadays, as per http://www.haskell.org/ghc/docs/latest/html/users_guide/type-families.html#data-instance-declarations.
  +
  +
An update of the Wiki also would be in place.
  +
[[User:obscaenvs|Fredrik Carlén]]

Latest revision as of 09:27, 12 July 2012

How does this change now that GHC 6.8.1 is out? MathematicalOrchid 12:55, 11 November 2007 (UTC)


In 4.3.2 Examples

module GMap (GMapKey(..), GMap(..)) where...: As before, but also exports all the data constructors GMapInt, GMapChar, GMapUnit, GMapPair, and GMapUnit.

should probably be:

module GMap (GMapKey(..), GMap(..)) where...: As before, but also exports all the data constructors GMapInt, GMapChar, GMapUnit, GMapPair, and GMapEither.


Paragraph 6 is a copy of Paragraph 4 except Collects is used.


In 7.3 Equality constraints

Why was `
~
' used, instead of `
=
` ?

StefanLjungstrand 19:55, 12 December 2007 (UTC)

[edit] GADT syntax in Type Families

GADT syntax is allowed nowadays, as per http://www.haskell.org/ghc/docs/latest/html/users_guide/type-families.html#data-instance-declarations.

An update of the Wiki also would be in place. Fredrik Carlén