On Tue, Nov 29, 2011 at 2:54 AM, Martin DeMello <martindeme...@gmail.com> wrote:
> On Tue, Nov 29, 2011 at 2:29 AM, Holger Siegel <holgersiege...@yahoo.de> 
> wrote:
>>
>> fromRawFile, fromSavedFile :: String -> IO [PairBox]
>> fromRawFile = mapM (\x -> makePair (x, "")) . lines
>> fromSavedFile = mapM makePair . parseFile
>>
>> setEditor :: Editor -> [PairBox] -> IO ()
>> setEditor ed = writeIORef ed . V.fromList
>>
>> importFile, loadFile :: Editor -> String -> IO ()
>> importFile ed = readfile >=> fromRawFile >=> setEditor
>> loadFile ed = readfile >=> fromSavedFile >=> setEditor
>
> Wow, very nice! First time I've truly grasped what >=> is good for.
> I'll need to go see where else I can use it in my code.

Quick question: what's the difference between

importFile ed = readfile >=> fromRawFile >=> setEditor ed

and

importFile = readfile >=> fromRawFile >=> setEditor

that the former compiles but the latter doesn't?

martin

>
> martin
>

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

Reply via email to