Sat, 8 Jul 2000 13:01:06 +0400 (MSD), S.D.Mechveliani <[EMAIL PROTECTED]> pisze:

>   arithmSequence :: Num a => a -> a -> Integer -> Mybe Integer
>                     --Ring
>                     --RingLike
> For example,  
>   arithmSequence -3.0 0.02 0 (Just 300) = [-3.0, -2.08, ..., 3.0]
>   arithmSequence -3.0 0.02 0 Nothing    = [-3.0, -2.08, ...]

I would use a simpler interface:

    arithSequence :: Num a => a{-start-} -> a{-step-} -> [a]
    
    take 300 (arithSequence (-3.0) 0.02)
    arithSequence (-3.0) 0.02
    takeWhile (<3.01) (arithSequence (-3.0) 0.02)

-- 
 __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/            GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK                5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


Reply via email to