[Haskell-cafe] introspection -- towards type algebra
rustompmody at gmail.com
Fri Apr 1 03:12:02 UTC 2016
I am looking for how far algebra on types in the manner of "set theory as
an algebra" ¹ is possible.
So for example in set theory one can compute for sets S, T
S∪T, S∩T, S-T etc
Is something similar possible for types?
Say I have
data Primary = Red|Green|Blue
data Othercolors = Violet|Indigo|Yellow|Orange
I want something like
Rainbow = Primary ∪ Othercolors
Equivalently if Rainbow and Primary had been defined, how to get/compute
Rainbow - Primary?
I thought the first-class types in Idris would be a good bet to try out at
least a trivial prototype.
So asking here.
Clearly and obviously one can use haskell to implement any language.
My question is what/which are the introspective libraries/features of
modern haskell that make this easy and lightweight.
¹ Yeah the term 'type algebra' may be taken in the sense of algebraic data
Cant think of a better one
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe