Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  (no subject) (emacstheviking)
   2. Re:  (no subject) (David Virebayre)
   3. Re:  (no subject) (emacstheviking)
   4. Re:  cabal -j (Brent Yorgey)
   5.  Categories in Haskell (Robert Goss)
   6.  can this be made shorter? (Emmanuel Touzery)
   7. Re:  can this be made shorter? (Felipe Almeida Lessa)
   8. Re:  can this be made shorter? (Emmanuel Touzery)


----------------------------------------------------------------------

Message: 1
Date: Wed, 29 May 2013 12:48:29 +0100
From: emacstheviking <[email protected]>
Subject: [Haskell-beginners] (no subject)
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CAEiEuUK87BjEFwr1uF-k88Pbq6yGR9sH6JHaxekXj31-4RGn=g...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On this page:

http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working-at-a-high-altitude-for-low-level-performance/

there is a link to a paper:

http://www.cse.unsw.edu.au/~dons/papers/CLS07.html

Alas, being only human it seems I am not allowed to read it lest I should
reveal the inner secret of the magic Circle.

Does anybody know if that paper is downloadable from another location?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130529/248e2465/attachment-0001.htm>

------------------------------

Message: 2
Date: Wed, 29 May 2013 14:34:57 +0200
From: David Virebayre <[email protected]>
Subject: Re: [Haskell-beginners] (no subject)
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <cam_wfvt9yyc4unjtin6xb-t3w5obamq83pqvk4wblfzncdy...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

2013/5/29 emacstheviking <[email protected]>:
> www.cse.unsw.edu.au/~dons/papers/CLS07.html

I think this is the right link :

http://code.haskell.org/~dons/papers/icfp088-coutts.pdf



------------------------------

Message: 3
Date: Wed, 29 May 2013 14:03:44 +0100
From: emacstheviking <[email protected]>
Subject: Re: [Haskell-beginners] (no subject)
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CAEiEuU+F2jx018gb1nb+-=0fzpr3e-gcjphqngxqkvkcpah...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Awesome. Thanks for that! :)

On 29 May 2013 13:34, David Virebayre <[email protected]> wrote:

> 2013/5/29 emacstheviking <[email protected]>:
> > www.cse.unsw.edu.au/~dons/papers/CLS07.html
>
> I think this is the right link :
>
> http://code.haskell.org/~dons/papers/icfp088-coutts.pdf
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130529/b740a08f/attachment-0001.htm>

------------------------------

Message: 4
Date: Wed, 29 May 2013 11:49:32 -0400
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] cabal -j
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

On Wed, May 29, 2013 at 09:01:45AM +0000, harry wrote:
> Brent Yorgey <byorgey <at> seas.upenn.edu> writes:
> 
> > Yes, edit your ~/.cabal/config and add/uncomment the line
> > 
> > jobs: 12
> 
> I just tried that with the new HP, and got
> cabal: Command.optionToFieldDescr: feature not implemented

What version of cabal do you have?  I.e. what is the output of

  cabal --version

?

-Brent



------------------------------

Message: 5
Date: Wed, 29 May 2013 18:01:13 +0100
From: Robert Goss <[email protected]>
Subject: [Haskell-beginners] Categories in Haskell
To: [email protected]
Message-ID:
        <canrvqsakd64+e4m_r7f4tuzslecqm74q8taqmmfmji530oz...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I am interested in trying to use category to perform some mathematical
computations. It seems natural to want to talk about categories of
mathematical objects e.g. Groups,Rings,Algebras ... etc. But I have found
some difficulty doing this with Haskell's standard Category libraries.

class Category m where
  id :: m a a
  comp :: m a b -> m b c -> m a c

The main issue is that the objects of the category (represented by the id
morphism) are in bijection to some set of haskell types.

The problem (I think) this leads too is that

1. All the objects that may appear in a program must be known to the
compiler. Which leads to problems (for me at least) as the application I
want to study I don't know all the (Groups,Rings,... etc) that I will need.
2. This requires representing (for example) all groups as types. In general
I have found while possible it leads to pretty horrendous types.

Now this all makes sense Haskell's categories are for reasoning about
programs while I want to use it more for pure maths. Has anyone else had a
similar problem with categories in haskell? Or am I missing a way of
implementing such structures within the standard Category framework for
haskell.

For a (toy) example take trying to model the category of CyclicGroups

--Cyclic n is the object representing the cyclic group Z_n
newtype Cyclic = Cyclic Int
--CyclicMor n m p is represents a group morphism from Z_n to Z_m taking 1
-> p
newtype CyclicMor = CyclicMor Int Int Int

This now gives the definition of

id :: Cyclic -> CyclicMor
id (Cyclic n) = CyclicMor n n 1

comp :: CyclicMor -> CyclicMor -> Maybe CyclicMor
comp (CyclicMor n m p) (CyclicMor n' m' p')
  | m==n' = Just (CyclicMor n m' (p+p'))
  | otherwise = Nothing

The main loss in this approach is compiler can no longer determine if
morphisms are compatible. In my project I use a slightly more generic
variant :

class OrdinaryCategory m where
  id :: a -> m a a
  comp :: m a b -> m b c -> Maybe (m a c)

I haven't seen a similar construction in haskell libraries does anyone know
if this is because
1. It is already there and I just haven't come across it.
2. It solves a problems that no-one else has had.
3. My idea is fundamentally broken / useless in some key way.

Thanks for any comments anyone has.

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130529/d268eeca/attachment-0001.htm>

------------------------------

Message: 6
Date: Wed, 29 May 2013 21:38:12 +0200
From: Emmanuel Touzery <[email protected]>
Subject: [Haskell-beginners] can this be made shorter?
To: "[email protected]" <[email protected]>
Message-ID:
        <CAC42RenZvYMURguNfTiG5U=n4_h-skmsyftgbhks2phzv57...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

hi,

 i want to know if a string contains only "." and "/" characters.

 i do something like that:

null . dropWhile (\c -> c == '.' || c == '/')

  now it's a shame, because if I wanted only to check for "." then I would
have:

null . dropWhile (=='.')

   afaik in scala you can say:

null . dropWhile (_ == '.' || _ == '/')

   which is a bit more compact than the haskell...

   I was thinking to use "and" but I'm not sure it would end up being
readable...

   Any idea? Or I am trying too hard to make it compact?

Emmanuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130529/888ba3cb/attachment-0001.htm>

------------------------------

Message: 7
Date: Wed, 29 May 2013 16:44:35 -0300
From: Felipe Almeida Lessa <[email protected]>
Subject: Re: [Haskell-beginners] can this be made shorter?
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CANd=ogeo8xv6rvt3w-ow+oct9um+eohg1-7mupg3bv+xv26...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Well, you could use:

    null . dropWhile (`elem` "./")

=)

On Wed, May 29, 2013 at 4:38 PM, Emmanuel Touzery <[email protected]> wrote:
> hi,
>
>  i want to know if a string contains only "." and "/" characters.
>
>  i do something like that:
>
> null . dropWhile (\c -> c == '.' || c == '/')
>
>   now it's a shame, because if I wanted only to check for "." then I would
> have:
>
> null . dropWhile (=='.')
>
>    afaik in scala you can say:
>
> null . dropWhile (_ == '.' || _ == '/')
>
>    which is a bit more compact than the haskell...
>
>    I was thinking to use "and" but I'm not sure it would end up being
> readable...
>
>    Any idea? Or I am trying too hard to make it compact?
>
> Emmanuel
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>



-- 
Felipe.



------------------------------

Message: 8
Date: Wed, 29 May 2013 21:50:08 +0200
From: Emmanuel Touzery <[email protected]>
Subject: Re: [Haskell-beginners] can this be made shorter?
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <cac42remtnbog_ajx8dqdkav0p_nyyx8oooadngwugp1ouj9...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Thank you, that's exactly what I was looking for!
I didn't spot "elem" so far... that's why I was looking into "and" which
was too complex for this case.

Thanks again!

emmanuel


On Wed, May 29, 2013 at 9:44 PM, Felipe Almeida Lessa <
[email protected]> wrote:

> Well, you could use:
>
>     null . dropWhile (`elem` "./")
>
> =)
>
> On Wed, May 29, 2013 at 4:38 PM, Emmanuel Touzery <[email protected]>
> wrote:
> > hi,
> >
> >  i want to know if a string contains only "." and "/" characters.
> >
> >  i do something like that:
> >
> > null . dropWhile (\c -> c == '.' || c == '/')
> >
> >   now it's a shame, because if I wanted only to check for "." then I
> would
> > have:
> >
> > null . dropWhile (=='.')
> >
> >    afaik in scala you can say:
> >
> > null . dropWhile (_ == '.' || _ == '/')
> >
> >    which is a bit more compact than the haskell...
> >
> >    I was thinking to use "and" but I'm not sure it would end up being
> > readable...
> >
> >    Any idea? Or I am trying too hard to make it compact?
> >
> > Emmanuel
> >
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
> >
>
>
>
> --
> Felipe.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130529/afae668d/attachment.htm>

------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 59, Issue 39
*****************************************

Reply via email to