1 line simple cat in Haskell

William Lee Irwin III wli@holomorphy.com
Thu, 14 Nov 2002 15:53:05 -0800


On Wed, 2002-11-13 at 22:43, William Lee Irwin III wrote:
>> There is a semantic difference here, as the version I posted above takes
>> files from the command-line, though it does fail to accommodate the
>> pass-through case, which is handled by: [...]

On Thu, Nov 14, 2002 at 05:33:59PM -0500, Tom Moertel wrote:
> I need this behavior often enough to justify writing a small module to
> provide it:
> Full version at http://tea.moertel.com/~thor/ravt/ravt-0.9/GetInput.hs
> getInputFromArgs        :: [String] -> IO String
> getInputFromArgs []     =  getContents
> getInputFromArgs xs     =  liftM concat (mapM readFromFile xs)

This looks very useful, though less general than nonEmptyMapM_


I'll likely be using myself.


Thanks,
Bill