nerogoal.blogg.se

Super vectorizer safe
Super vectorizer safe













super vectorizer safe

Notice that the Applicative class is not a super class of Monad. There's probably something deep going on here that I'm just not aware of. It's only member function is the (>) operator. This class is a hack to make monads play nice with do notation We've introduced a new class Then that does not depend on the Category. Semantically, both have the same meaning, but the monotonic fmap runs faster. OrdHask)Īnd the category of monotonic functions (i.e. The category of functions with an Ord constraint (i.e. This modified functor hierarchy gives us a lot of power.įor example, we can finally make Set an instance of Monad!Īctually, Set is an instance of Monad in two separate categories: The dashed lines above mean that the Functor, Applicative, and Monad instances can depend on a category. The image below shows the functor hierarchy: SubHask generalizes this definition to endofunctors on any category:Ĭlass Category cat => Functor cat f where In the standard Prelude, the Functor type class corresponds to "endofunctors on the category Hask". Some of Arrow's functionality has also been removed since I've never found a use for it,īut it will probably be added at a future point as SubHask matures. I have removed the Arrow hierarchy in favor of a more principled approach. The design of these transformers roughly follows that of the mtl library to allow for composition of transformers. The categories can be found in the SubHask.Category.* modules,Īnd transformers can be found in .* modules. Subtyping is not a builtin feature of the Haskell language, but we simulate subtyping using the class * -> *) -> * -> * -> * to construct the category MonT (->) :: * -> * -> *, which corresponds to the category of monotonic functions.

super vectorizer safe

More formally, a Concrete category is one that is a subtype of (->). Intuitively, Concrete categories are functions that have been annotated with special properties. The image below shows the category hierarchy: The modified category hierarchy closely follows the presentation in the Rosetta Stone paper. See the examples folder for the literate haskell files. Will build the project, run the tests, and run the benchmark. To install on Linux or Mac, run the following commands: You can download the latest version of GHC here. Sets are monads in the category OrdHask and Mon.This README is intended to be a "quick start guide" to get you familiar with the current status and major differences from standard Haskell. To achieve this goal, almost every class hierarchy is redefined to be more general. The main idea is to use a type safe interface for programming in arbitrary subcategories of Hask.įor example, the category Vect of linear functions is a subcategory of Hask, and SubHask exploits this fact to give a nice interface for linear algebra. The goal is to make numerical computing in Haskell fun and fast. SubHask is a radical rewrite of the Haskell Prelude.















Super vectorizer safe