haskell-turtle

Should I use folds in Turtle or Foldl packages?

谁说胖子不能爱 提交于 2020-01-04 04:00:51
问题 I'm having some difficulty using Turtle and only after several minutes staring at incomprehensible error messages realized that I was using wrong fold function. https://hackage.haskell.org/package/turtle-1.5.8/docs/Turtle-Shell.html#v:fold https://hackage.haskell.org/package/foldl-1.4.0/docs/src/Control.Foldl.html#fold Why is there a name collision? I don't believe that's coincidence but I cannot figure it out. Are these inherently different kinds of folds? To be concrete, I wanted to fold a

With haskell's turtle library, how to extract filename as String from FilePath?

一曲冷凌霜 提交于 2019-12-11 11:56:09
问题 When using takeFileName I get a type error: :t v print v :t takeFileName takeFileName v v :: FilePath FilePath "/media/miguel/backup/backups" takeFileName :: FilePath -> FilePath Couldn't match type ‘Turtle.FilePath’ with ‘String’ Expected type: IHaskellSysIO.FilePath Actual type: Turtle.FilePath In the first argument of ‘takeFileName’, namely ‘v’ In the expression: takeFileName v Is it because turtle's FilePath is different from prelude's FilePath ? 回答1: Turtle still uses system-filepath