Re: *By functions in list utilities library

1996-05-16 Thread Sigbjorn Finne
Following up to my own post :-{, but after further communication with Mike Gunter, a good example for why generalising some of the *By functions List is a good idea was presented, namely that of deleteFirstsBy deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] generalising it to delet

Re: *By functions in list utilities library

1996-05-16 Thread reid-alastair
Mike Gunter and Sigbjorn Finne propose generalising the type of the *By functions as follows: deleteBy :: (a -> Bool) -> [a] -> [a] deleteFirstsBy :: (a -> b -> Bool) -> [a] -> [b] -> [a] notElemBy,elemBy :: (a -> Bool) -> [a] -> [a] -- or just stick with any? lookupBy

Re: Monads and data structures

1996-05-16 Thread Klaus Georg Barthelmann
Hi! I was told by Magnus Carlsson and Enno Scholz that my proposal lookup :: (Eq a, Monad m, MonadZero n) => a -> m (a,b) -> n b lookup i ps = do (k,v) <- ps if k==i then return v else zero isn't well-typed. I'm sorry for this bug. (I cannot access a compiler for Ha

Haskell 1.3 - what's it all about?

1996-05-16 Thread Magnus Carlsson
Maybe you have seen some mail lately on this list about something called "Haskell 1.3", and wondered What is this "Haskell 1.3" anyway?, Can I buy it?, or Do I have it? By compiling and running the following two-module Haskell program, you will at least get an answer to the last que

Monads and data structures

1996-05-16 Thread Klaus Georg Barthelmann
Dear friends of Haskell, a few days ago I asked the question: > 2) The library proposal does not contain any advanced data structures (yet). > How would one declare, for example, ordered sets as an instance of > Monad[Plus]? Alastair Reid answered as follows: > Ordered sets are a pro