Re[4]: [Haskell-cafe] Re: ANN: System.FilePath 0.9

2006-07-24 Thread Bulat Ziganshin
Hello Spencer,

Monday, July 24, 2006, 6:38:17 PM, you wrote:

> I've been writing a Stringable class for my SoC project.  You can
> check out the code at
> http://darcs.haskell.org/SoC/fps-soc/Data/Stringable.hs.

i've downloaded full fps-soc repository. 2 questions:

why you don't include this into FPS library? your modules anyway stay
alone, but for practical usage it would be more useful

why not extend this to the "class ListLike ce e | ce->e" ?  all
functions in your definitions is not Char-specific, so i think it's
just meaningless waste of generality. it will be great to import
list-processing functions definitions from MissingH and use them to
define either generic algorithms (which uses with any list-like data
structures) or list-specific ones

there are also similar classes in Collections (and Edison) libs, but
it seems that you (and Don) don't have any plans to interoperate with
these libs. at least, your class will be a great base for libs like
FilePath by Neil Mitchell

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[4]: [Haskell-cafe] Re: ANN: System.FilePath 0.9

2006-07-23 Thread Bulat Ziganshin
Hello Brian,

Sunday, July 23, 2006, 5:31:35 PM, you wrote:

>>> instance IString ByteString.Char8 ...
>>> instance IString String ...
>> class ListLike ce e | ce->e

> class ISeq seq_a a | seq_a -> a where -- (*)

there is also Collection library:
darcs get --partial http://darcs.haskell.org/packages/collections/

it contains many classes, including:

-- | Class of sequential-access types.
-- In addition of the 'Collection' services, it provides deconstruction and 
concatenation.
class (Monoid c, Collection c a a) => Sequence c a where
-- | The first @i@ elements of a sequence.
take :: Int -> c -> c
-- | Elements of a sequence after the first @[EMAIL PROTECTED]
drop :: Int -> c -> c
-- | Split a sequence at a given index.
splitAt :: Int -> c -> (c,c)
-- | Reverse a sequence.
reverse :: c -> c
-- | Analyse the left end of a sequence.
front :: Monad m => c -> m (a,c)
-- | Analyse the right end of a sequence.
back :: Monad m => c -> m (c,a)
-- | Add an element to the left end of a sequence.
cons :: a -> c -> c
-- | Add an element to the right end of a sequence.
snoc :: c -> a -> c
-- | The 'isPrefix' function takes two seqences and returns True iff 
-- the first is a prefix of the second.
isPrefix :: Eq a => c -> c -> Bool


but this class is not ideal for integration with ByteString library
which implements many custom algorithms which (i suppose) use details
of ByteString implementation. so, something like

class (Sequence c a) => ListLike c a where
  split, splitBy

would be useful. and then we should integrate your idea:

>  class IChar c where
>  class (IChar c, ISeq s c) => IString s where

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe