On 5/8/13 12:14 PM, Conal Elliott wrote:
Hi Wren,
Have you taken this constrained categories experiment further,
particularly for adding products? As I mentioned in a haskell-cafe note
yesterday, I tried and got a frightening proliferation of constraints when
defining method defaults and
Hi Wren,
Have you taken this constrained categories experiment further,
particularly for adding products? As I mentioned in a haskell-cafe note
yesterday, I tried and got a frightening proliferation of constraints when
defining method defaults and utility functions (e.g., left- or
Hi,
Christopher Howard wrote:
instance Category ...
The Category class is rather restricted:
Restriction 1:
You cannot choose what the objects of the category are. Instead, the
objects are always all Haskell types. You cannot choose anything at
all about the objects.
Restriction 2:
You
It would definitely be nice to be able to work with a partial Category
class, where for example the objects could be constrained to belong to a
class. One could then restrict a Category to a type level representation
of the natural numbers or any other desired set. Kind polymorphism should
make
On Fri, 21 Dec 2012, Chris Smith cdsm...@gmail.com wrote:
It would definitely be nice to be able to work with a partial Category
class, where for example the objects could be constrained to belong to a
class. One could then restrict a Category to a type level representation
of the natural
On 12/20/12 7:07 PM, Christopher Howard wrote:
On 12/20/2012 03:59 AM, wren ng thornton wrote:
In order to fake this theory in Haskell we can do:
newtype MonoidCategory a i j = MC a
instance Monoid a = Category (MonoidCategory a) where
id = MC mempty
MC f
On 12/21/12 2:35 PM, Chris Smith wrote:
It would definitely be nice to be able to work with a partial Category
class, where for example the objects could be constrained to belong to a
class. One could then restrict a Category to a type level representation
of the natural numbers or any other
I've perhaps been trying everyones patiences with my noobish CT
questions, but if you'll bear with me a little longer: I happened to
notice that there is in fact a Category class in Haskell base, in
Control.Category:
quote:
class Category cat where
A class for categories. id and (.)
Hi Christopher,
a data type can be an instance of Category only if it has kind * - * - *.
It must have 2 type parameters so that you could have types like 'cat a a'.
Some simple examples:
import Prelude hiding (id, (.))
import Control.Category
import Data.Monoid
-- See
On 12/20/12 6:42 AM, Christopher Howard wrote:
code:
instance Category Integer where
id = 1
(.) = (*)
-- and
instance Category [a] where
id = []
(.) = (++)
---
But these lead to kind mis-matches.
As mentioned in my other email (just posted) the kind mismatch is
On Thu, 20 Dec 2012, Christopher Howard christopher.how...@frigidcode.com
wrote:
I've perhaps been trying everyones patiences with my noobish CT
questions, but if you'll bear with me a little longer: I happened to
notice that there is in fact a Category class in Haskell base, in
On 12/20/2012 03:59 AM, wren ng thornton wrote:
On 12/20/12 6:42 AM, Christopher Howard wrote:
As mentioned in my other email (just posted) the kind mismatch is
because categories are actually monoid-oids[1] not monoids. That is:
class Monoid (a :: *) where
mempty :: a
I've perhaps been trying everyones patiences with my noobish CT
questions, but if you'll bear with me a little longer: I happened to
notice that there is in fact a Category class in Haskell base, in
Control.Category:
quote:
class Category cat where
A class for categories. id and
On Thu, 20 Dec 2012, Christopher Howard christopher.how...@frigidcode.com
wrote:
On 12/20/2012 03:59 AM, wren ng thornton wrote:
On 12/20/12 6:42 AM, Christopher Howard wrote:
As mentioned in my other email (just posted) the kind mismatch is
because categories are actually monoid-oids[1]
On 12/20/12 10:05 PM, Jay Sulzberger wrote:
What does the code for going backwards looks like? That is,
suppose we have an instance of Category with only one object.
What is the Haskell code for the function which takes the
category instance and produces a monoid thing, like your integers
with
On Thu, 20 Dec 2012, Gershom Bazerman gersh...@gmail.com wrote:
On 12/20/12 10:05 PM, Jay Sulzberger wrote:
What does the code for going backwards looks like? That is,
suppose we have an instance of Category with only one object.
What is the Haskell code for the function which takes the
16 matches
Mail list logo