-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.12.0 release notes #332
Comments
Fantastic stuff! Thank you to everyone who helped get such a big release out the door. |
How is the string representation of functions in the REPL implemented? (I'm pretty sure this is not the right place to ask this, but that feature blew my mind and I really, really want to know how to do it.) |
Hi @fvictorio, in NodeJS, you can override the This feature is used by Most functions (if not all) exported by Sanctuary were defined using
That's alright. If you're looking for a place to ask general questions, the Gitter channel is quite active :) |
v0.11.1...v0.12.0
Overview
This is a huge release, representing hundreds of hours of work over the course of more than eight months, spanning multiple projects. I'm thrilled to be able to share the result. Many thanks to those who contributed to this release, either by submitting pull requests or by participating in discussions on GitHub and Gitter.
Ramda
Sanctuary began life as a tiny library intended for use alongside Ramda. At the time Ramda provided several partial functions such as
R.head
(this is still the case today). Since Sanctuary's inception two years ago, Ramda and Sanctuary have diverged philosophically to the point that it's now reasonable for Sanctuary to duplicate much of Ramda's functionality. Until now, though, Sanctuary has lacked crucial functions such asmap
,ap
, andchain
.Fantasy Land
Thanks in large part to sanctuary-type-classes, Sanctuary now supports version 3 of the Fantasy Land specification. There are two aspects to this:
fantasy-land/
-prefixed methods; andIn the Sanctuary world, Fantasy Land methods are not intended for direct use. Until now one was expected to use
R.map(f, maybe)
rather thanmaybe.map(f)
. Now that Sanctuary provides amap
function, the recommended expression isS.map(f, maybe)
. SinceS.map
enforces its invariants (if type checking is enabled) there's no reason forS.Maybe.prototype['fantasy-land/map']
to do so as well. As a result, methods of the Maybe and Either types no longer perform type checking.sanctuary-def
sanctuary-js/sanctuary-def@v0.6.0...v0.9.0
Sanctuary now depends on
sanctuary-def@0.9.0
which is significantly more capable than the version on which Sanctuary previously depended. It now supports higher-order functions and unary (and binary) type variables. For example:Sanctuary functions now have useful string representations for those who enjoy the REPL:
Breaking changes
Nothing()
is now known simply asNothing
(maybe: change type of S.Nothing from ‘-> Maybe a’ to ‘Maybe a’ #225)and
andor
are now monomorphic (logic: make S.and and S.or monomorphic, and remove S.xor #279)xor
has been removed (logic: make S.and and S.or monomorphic, and remove S.xor #279)meld
has been removed (composition: remove S.meld #280)flip
is now known asflip_
(Remove extraneous combinators #330)C
is now known asflip
(Remove extraneous combinators #330)B
is now known only ascompose
(Remove extraneous combinators #330)S
has been removed in favour ofap
(fantasy land: add Fantasy Land functions #216)lift
is now known asmap
(fantasy land: add Fantasy Land functions #216)match
now has a more appropriate type (regexp: revise S.match and add S.matchAll #283)pluck
now hasprop
semantics rather thanget
semantics (Change pluck to be more prop-like #293)get
,gets
, andparseJson
now take predicates rather than type representatives (Change type validators to use predicate instead of TypeRep #191)New exports
__ :: Placeholder
(sanctuary-def@0.8.0 #232)alt :: Alt f => f a -> f a -> f a
(fantasy land: add Fantasy Land functions #216)ap :: Apply f => f (a -> b) -> f a -> f b
(fantasy land: add Fantasy Land functions #216)apFirst :: Apply f => f a -> f b -> f a
(fantasy land: add Fantasy Land functions #216)apSecond :: Apply f => f a -> f b -> f b
(fantasy land: add Fantasy Land functions #216)bimap :: Bifunctor f => (a -> b) -> (c -> d) -> f a c -> f b d
(fantasy land: add Fantasy Land functions #216)chain :: Chain m => (a -> m b) -> m a -> m b
(fantasy land: add Fantasy Land functions #216)chainRec :: ChainRec m => TypeRep m -> (a -> m (Either a b)) -> a -> m b
(fantasy land: add Fantasy Land functions #216)curry2 :: ((a, b) -> c) -> a -> b -> c
(Curry: Add functions curry2 through curry5 #289)curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d
(Curry: Add functions curry2 through curry5 #289)curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -> e
(Curry: Add functions curry2 through curry5 #289)curry5 :: ((a, b, c, d, e) -> f) -> a -> b -> c -> d -> e -> f
(Curry: Add functions curry2 through curry5 #289)empty :: Monoid a => TypeRep a -> a
(fantasy land: add Fantasy Land functions #216)equals :: Setoid a => a -> a -> Boolean
(fantasy land: add Fantasy Land functions #216)extend :: Extend w => (w a -> b) -> w a -> w b
(fantasy land: add Fantasy Land functions #216)extract :: Comonad w => w a -> a
(fantasy land: add Fantasy Land functions #216)filter :: (Applicative f, Foldable f, Monoid (f a)) => (a -> Boolean) -> f a -> f a
(fantasy land: add Fantasy Land functions #216)filterM :: (Monad m, Monoid (m a)) => (a -> Boolean) -> m a -> m a
(fantasy land: add Fantasy Land functions #216)fromEither :: b -> Either a b -> b
(Add S.fromEither to pull out values from either #229)fromMaybe_ :: (() -> a) -> Maybe a -> a
(maybe: add S.fromMaybe_ #316)join :: Chain m => m (m a) -> m a
(fantasy land: add Fantasy Land functions #216)joinWith :: String -> Array String -> String
(string, array: add S.splitOn and S.joinWith #256)matchAll :: GlobalRegExp -> String -> Array { match :: String, groups :: Array (Maybe String) }
(regexp: revise S.match and add S.matchAll #283)maybe_ :: (() -> b) -> (a -> b) -> Maybe a -> b
(added S.maybe_ function #285)mean :: Foldable f => f FiniteNumber -> Maybe FiniteNumber
(Add S.mean that calculates mean of values of a foldable #234)of :: Applicative f => TypeRep f -> a -> f a
(fantasy land: add Fantasy Land functions #216)on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
(Added function S.on #282)on_ :: ((b, b) -> c) -> (a -> b) -> a -> a -> c
(Added function S.on #282)promap :: Profunctor p => (a -> b) -> (c -> d) -> p b c -> p a d
(fantasy land: add Fantasy Land functions #216)props :: Accessible a => Array String -> a -> b
(Add S.props #310)sequence :: (Applicative f, Traversable t) => TypeRep f -> t (f a) -> f (t a)
(fantasy land: add Fantasy Land functions #216)splitOn :: String -> String -> Array String
(string, array: add S.splitOn and S.joinWith #256)toEither :: a -> b? -> Either a b
(AddstoEither :: a -> b? -> Either a b
#249)toString :: Any -> String
(fantasy land: add Fantasy Land functions #216)traverse :: (Applicative f, Traversable t) => TypeRep f -> (a -> f b) -> t a -> f (t b)
(fantasy land: add Fantasy Land functions #216)zero :: Plus f => TypeRep f -> f a
(fantasy land: add Fantasy Land functions #216)Contributors
The text was updated successfully, but these errors were encountered: