Skip to content

Version 0.6 changes

Michael Snoyman edited this page Sep 24, 2013 · 10 revisions

At the time of writing, I'm experimenting with a new version based on mono-traversable. This will probably become version 0.6. As I'm experimenting with things, I'll try to keep notes on notable changes.

  • Far fewer type classes.
  • map is now just fmap and won't work for monomorphic containers or Sets.
    • For monomorphic containers, use omap.
    • For sets, unboxed vectors, and storable vectors, use looseMap.
  • For Maps, you must use mapFromList and mapToList. Similar for Sets: setFromList and setToList.
  • insert, delete, singleton are now insertMap/deleteMap/singletonMap or insertSet/deleteSet/singletonSet.
  • singleton works for sequences (ByteString, Vector, etc)
  • No more empty, just use mempty.
  • Less built-in FilePath support. Use fp(From/To)(String/Text)
  • elem/notElem works for sequences, member/notMember works for containers (Map/Set)
  • fold becomes foldl'
  • show is now monomorphic (produces a String), you should use tshow if you want Text.
  • ClassyPrelude.Conduit has a bunch of chunked functions.
  • <> is now imported from Semigroup. If you want Monoidal appending instead (e.g., you're using a datatype without a Semigroup instance), use ++.

Notice the pattern: there are a number of places where you need to be much more explicit about which function you're going to use (mapFromList vs. pack/fromList). Overall, I think it's actually a nice change, as code becomes more readable.

Clone this wiki locally