-
Notifications
You must be signed in to change notification settings - Fork 15
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 justfmap
and won't work for monomorphic containers or Sets.- For monomorphic containers, use
omap
. - For sets, unboxed vectors, and storable vectors, use
looseMap
.
- For monomorphic containers, use
- 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 usemempty
. - 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 aString
), you should usetshow
if you wantText
. - ClassyPrelude.Conduit has a bunch of chunked functions.
-
<>
is now imported fromSemigroup
. If you wantMonoid
al appending instead (e.g., you're using a datatype without aSemigroup
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.