5 ms·
The tutorial does a great job of explaining why this is interesting: http://hackage.haskell.org/package/turtle-1.0.0/docs/Turtle-Tutorial.html http://hackage.ha
by Doji 12y ago
The tutorial does a great job of explaining why this is interesting: http://hackage.haskell.org/package/turtle-1.0.0/docs/Turtle-Tutorial.html http://hackage.haskell.org/package/turtle-1.0.0/docs/Turtle-...
For example, the pwd function returns a FilePath type rather than a String:
Prelude Turtle> :type pwd
pwd :: IO Turtle.FilePath
The datefile function is also typed:
Prelude Turtle> :type datefile
datefile :: Turtle.FilePath -> IO UTCTime
So this really does seem to structure the data passed between commands, instead of the "stringly typing" unix shells have historically been known for.
- TazeTSchnitzel 12y agoAre those types just aliases of String?
- marcosdumay 12y agoWhat do you mean by "alias"? Path carries String-like information, it can even be easily converted to and from strings. Yet, it's a strong type that won't let you write something like 'path </> file_contents' (although, with overloaded strings, you can do 'path </> "file_name"'). UTCTime is not String-like.
- throwaway283719 12y agoNo. For example, a FilePath is (after resolving a few other type aliases) data Root = RootPosix | RootWindowsVolume Char | RootWindowsCurrentVolume data FilePath = FilePath { pathRoot :: Maybe Root , pathDirectories :: [String] , pathBasename :: Maybe String , pathExtensions :: [String] }