[Haskell-cafe] Relevance and applicability of category theory
Dan Weston
westondan at imageworks.com
Thu Jan 31 18:01:50 EST 2008
> Hmmm, not sure what you asking for. If you have a monad instance Set a
> that has Eq a attached, this
> already would do what you want, no? An example would help me to
> understand...
Sorry, I meant uppercase (and got the constraint wrong anyway). I meant
that Ord a => Set a was a monad (lowercase 'm') under the obvious
semantics, but cannot be an instance of Monad. The type signature of
Haskell's Monad class is too free (admits too many types, not just Ord a
=> a) to have a Set instance.
[But for solutions, see
http://www.randomhacks.net/articles/2007/03/15/data-set-monad-haskell-macros
http://okmij.org/ftp/Haskell/types.html#restricted-datatypes
http://hackage.haskell.org/packages/archive/monad-param/0.0.2/doc/html/Control-Monad-Parameterized.html
]
I was just wondering if your Thrist type constructor included (e.g. in
its first argument) a mechanism for embedding a Set monad, since this is
already a subject of some interest to many people.
Dan
Gabor Greif wrote:
> Am 31.01.2008 um 18:13 schrieb Dan Weston:
>
>> Even though you cannot "dive into this matter now", maybe when you get
>> time you can update your blog with an explicit embedding of Haskell
>> monads and arrows in your Thrist construction. Concrete examples will
>> help me (and probably others) more quickly see the novelty, increased
>> generality, and usefulness of a Thrist.
>
> Okay, I took my time and came up with:
>
> http://heisenbug.blogspot.com/2008/01/embeddings-part-one-arrow-thrist.html
>
> Comments welcome.
>
>
>>
>> Also, although you say that thrists are the moral equivalent of a free
>> category, it appears (at least to me) possible that the first Thrist
>> argument enables the construction of a restricted domain monad, e.g.
>> (Eq a => Set a) monad. Is this so?
>
> Hmmm, not sure what you asking for. If you have a monad instance Set a
> that has Eq a attached, this
> already would do what you want, no? An example would help me to
> understand...
>
>
>>
>> Dan
>
> Cheers,
>
> Gabor
>
>
>>
>>
>
>
More information about the Haskell-Cafe
mailing list