It seems to me that there are two possible reasons for implementing category theoretic structures in FriCAS:

1) Because FriCAS should implement as many mathematical structures as possible and because much of modern mathematics is done in the language of categories and FriCAS should reflect the structures mathematicians are using.

2) To implement Haskel-like structures. This is aimed at separating the 'pure' from the 'impure' in particular chaining together sequences of potentially impure functions.

I think this distinction is important because it determines what type of structure is used. In the first case we might use this:

 class Monad m where
   unit :: a -> m a
   mult :: m (m a) -> m a

But in the second case we might use this:

 class Monad m where
   (>>=) :: m a -> (a -> m b) -> m b
   (>>) :: m a -> m b -> m b
   return :: a -> m a
   fail :: String -> m a

So in the case of Maybe, in the second case we could chain together a whole sequence of functions with a signature like this:

Something -> Maybe Something

into a combined function, this would mean that we would not have to test for "fail" in-between each function call.

In the first case we would have a structure like this:

Maybe (Maybe Something)

which, presumably would return "fail" if either the inner or outer Maybe failed.

I suspect this is all a bit academic because I get the impression that the FriCAS compiler is too unpredictable to make the changes to the type system that would be required for a more general category theoretic structures. Please tell me I'm wrong as it would be really wonderful if FriCAS could support this in its most general form.

Martin B

You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to