[Haskell-beginners] Parametrizing [] as an instance of the Functor type class

Alexander Berntsen alexander at plaimi.net
Thu Dec 31 13:10:18 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 31/12/15 14:06, Olumide wrote:
> Overall, I'm a bit confused about the relationship between the type
>  constructor f and [].
f = []. In other words, [] *is* the type constructor.

In Haskell, [] is both the type constructor for lists *and* the term
level value for an empty list. This is unfortunate. In ghci you can
see this.

? :t []
[] :: [t] -- term level
? :k []
[] :: * -> * -- type level
- -- 
Alexander
alexander at plaimi.net
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJWhSk5AAoJENQqWdRUGk8BPHcQAOHzfxcEQ+ZTQ5VMZjNo2cC5
5dXKFg2h0jGho4FhUNWeJ4EPSiyYHTEmyK3ZL2KSYoTVAPq/PyeZMdJFRgVRAeyz
Ktyv00E9oJQqjxUrZi7YiE+Y/KteqjE8Hy0X9QW7ICgcU1M9a13o6L+CLdoYrCj8
K6Dto35O7aZRLLQTjoZBm0I6VeDF9WDJPQwZrmXopXhixKrEad8EPne/Tt/yXlTr
Yl2Wya5w+f/xkD6G3T7nHz6Z2CtVhzfqTMO+9OoDkNnt8kFC1ZCsdDicbryEcvEA
0WlURPfjTMRCffrKz8N5SeyzgSF29EJATY2U9yg1l2gajiHxo+Veg1HXF2EMr5RZ
HF1DJyykXOOpel2VBY+ljtUsVP2J1gF7CoGjAzQnIQhGq3n/DOzmieRCZrZ4eC2W
8gUKyQwd4VPSI+YCZ+io9/NIXETpA+TIUdEYI5Goje4laN5lvddwAc0ADAbWPfyt
bsVjlmu3nC3EhG/7qw3KfA4KBiCXU8hH+8zvzDFYjBMX2bxnd/42jiJ8HyNVPYhW
s1FB3ndNUU/tHQzsSye3DXdL6mZ/PsDCT4RAcKc6HMTOP2K04DR8Nmo9Ag6RV0Pw
VomcJkESFZYYG1vPrdbxDRAWJgGIsMd1UpuPe5r6uzj06Xh9zmoLIqVxB3u2Um8k
AnGPKK8WBdguP09bjG0Q
=8v7y
-----END PGP SIGNATURE-----


More information about the Beginners mailing list