haskell
文章平均质量分 83
iteye_13882
这个作者很懒,什么都没留下…
展开
-
haskell - Functors, Applicative Functors and Monoids - Applicatives
Applicative is a special form of functor, in our previoius post we have already discussed the functor with ((->) r); now, we will see the beefed up functor, which is in the Applicator typec...原创 2013-04-22 07:24:14 · 90 阅读 · 0 评论 -
haskell - types and typeclasses - type synonyms
We know that [Char] and String are equivalent and interchangeable . And this is achieved by the type synonyms. Type synonyms don't really do anything per se, they're just about giving some type...原创 2013-04-20 09:51:15 · 80 阅读 · 0 评论 -
haskell - types and typeclasses - Derived Instances
Now that you have made your own type and typeclasses. how to make these two associated. As you might have known that a type can be made an instance of a typeclasss if it supports that behavior. e...原创 2013-04-20 09:50:59 · 89 阅读 · 0 评论 -
haskell - types and typeclasses - type parameters
A value constructor can take some values parameters and then produce a new value. For instance, the Car constructor takes three values and produces a car value. In a similar manner, type constructors...原创 2013-04-19 09:39:13 · 104 阅读 · 0 评论 -
haskell - types and typeclasses - new types
We have already covered some existing haskell types and typeclasses. In this chapter, we'll learn how to make our own and how to put them to work! First we will introduce new types and we will s...原创 2013-04-19 09:35:12 · 82 阅读 · 0 评论 -
haskell - modules - define your own modules
this is an additional post called "haskell - modules - import and common modules". We've looked at some cool modules so far, but how do we make our own module? Almost every programming language...原创 2013-04-19 09:34:38 · 99 阅读 · 0 评论 -
haskell - Modules - import, common modules
Module in Haskell is a re-use unit where you can put things that is generic enough then the module it exports can be used in a multitude of different programs.A Haskell module is a collection of rel...原创 2013-04-19 09:33:25 · 263 阅读 · 0 评论 -
Haskell - Higher order functions
Haskell functions can take functions as parameters and return functions as return values. A function that does either of those is called a higher order function. Higher order functions aren't just a...原创 2013-04-19 09:32:26 · 152 阅读 · 0 评论 -
haskell - recursion
Haskell is such an language that you can leverage aided with recursion, you can solve a load of issues. we will going to examine some examples which can be solved by the recursion, problem such ...原创 2013-04-18 14:30:29 · 137 阅读 · 0 评论 -
haskell - syntax in functions - case expressions
This is an advanced topic to the post haskell - syntax in functions , where we wil dicuss the the case expressions. By the name, you might have figured out that the case expression is, well, ex...原创 2013-04-18 11:18:34 · 102 阅读 · 0 评论 -
haskell - syntax in functions - where clause
This is an advanced topic to the post haskell - syntax in functions , where we wil dicuss the let in construct. Some general guideline about the 'let in' binding. Where bindings are a syntactic ...原创 2013-04-18 11:06:11 · 95 阅读 · 0 评论 -
haskell - types and typeclasses - Recursive Data Structures
we can make types whose constructors have fields that are of the same type! such as the trees where left child and right child are also a tree. We are going to inspect one type which represents...原创 2013-04-20 09:51:51 · 71 阅读 · 0 评论 -
haskell - types and typeclasses - typeclasses
we've learned about some of the standard Haskell typeclasses and we've seen which types are in them. We've also learned how to automatically make our own types instances of the standard typeclasses...原创 2013-04-20 09:52:30 · 81 阅读 · 0 评论 -
haskell - Functors, Applicative Functors and Monoids
Functor is the Functors , or functors are essentially haskell. We will introduce something about functors, then we might progress to Applicative Functors. Newtype keyword and others. So, th...原创 2013-04-22 07:23:15 · 85 阅读 · 0 评论 -
haskell - Functionally solving problems - Heathrow to London
Ensuing to the discussion that we had on the functionally solving problems that we had before. Where we have Reverse Polish notation calculator, we have yet another problem to solve, which is called...原创 2013-04-22 07:20:24 · 84 阅读 · 0 评论 -
haskell - Functionally solving problems - Rerverse Polish Notation Caculator
So far we have introduced the basic construct that underpinning the haskell runtime and etc... Now we can come to the point where we leverage the haskell language to functinally solving some problem...原创 2013-04-22 07:12:09 · 82 阅读 · 0 评论 -
haskell - Input and Output - exceptions
you might be wondering why the exceptions are in the input and outptu chapter, is there a fit, actually, the resaons why the haskell appears in the input and output chapter has its own reason. ...原创 2013-04-22 07:09:28 · 129 阅读 · 0 评论 -
haskell - Input and Output - ByteString
we know that we have lists, where we have used extensivly in many a occasion, but we how about we process the files because list is essentailly just a promise of a list, and so on. So you can think o...原创 2013-04-21 22:28:42 · 92 阅读 · 0 评论 -
haskell - Input and Output - Randomness
n most other programming languages, you have functions that give you back some random number. Each time you call that function, you get back a (hopefully) different random number. How about Haskell?...原创 2013-04-21 22:05:43 · 116 阅读 · 0 评论 -
haskell - Input and Output - Command Line
Command line is pretty all a necessity if you want to make a scritp or application that runs a terminal . The System.Environment module has two cool I/O actions. One is getArgs, which has a typ...原创 2013-04-21 21:02:37 · 73 阅读 · 0 评论 -
haskell - Input and Output - Files and Streams
so far what we have dealt with are all functions and streams. now we might get our hand wet dealing with Files and Streams. what we will discusses in this post includes: getContent and ge...原创 2013-04-21 21:02:01 · 79 阅读 · 0 评论 -
haskell - Input and Output - helloworld
We've mentioned that Haskell is a purely functional language. Whereas in imperative languages you usually get things done by giving the computer a series of steps to execute, functional programming ...原创 2013-04-21 21:01:20 · 171 阅读 · 0 评论 -
haskell - types and typeclasses - kinds
We have so far examine the types and typeclasses and we can make some types part of the typeclasses, however, we might have find out that some typeclasses expect to pass in a concrete type while som...原创 2013-04-20 09:53:04 · 92 阅读 · 0 评论 -
haskell - syntax in functions - guards
This is an advanced topic to the post haskell - syntax in functions , where we wil dicuss the Guards in functions.Whereas patterns are a way of making sure a value conforms to some form and deconstr...原创 2013-04-18 10:57:36 · 119 阅读 · 0 评论 -
haskell- syntax in functions
In this post we will examine some of the cool syntax that involves hte discussion of pattern matching, we will then discuss some advanced topic such as guard, where clause, let in and case statement...原创 2013-04-18 10:48:22 · 103 阅读 · 0 评论 -
haskell - write haskell modules and load/import in ghci
You may want to write up some haskell modules and put it into the interactive ghci command prompt so that you can see how it works out... it is more a repl things.suppose that you have write the f...原创 2013-04-03 19:03:41 · 100 阅读 · 0 评论 -
haskell - Monads - difference lists
as We seen in previous example, where it is very low effecient to construct the list by appending, while if hte list is constructed in the wrong order, the performance can be worse, So if there is so...原创 2013-05-12 18:50:14 · 114 阅读 · 0 评论 -
haskell - few more monad - Writer Monad
We will going to examine more monad, which will makes us more easily with a more variety of problems. exploring a few monads more will also solidify our intuition for monads. to install the Mon...原创 2013-05-11 23:23:31 · 138 阅读 · 0 评论 -
haskell - Monads - problem solving : A knight's quest
let's use the monad to solve some problems. here is a famous question, Say you have a chess board and only one knight piece on it. We want to find out if the knight can reach a certain position ...原创 2013-05-11 21:36:42 · 100 阅读 · 0 评论 -
haskell - Monads - the list monad
in this post, we will going to examine the list a monad, first let's see what is the definition of the list monad, here is the definition of the instance Monad [] where return x = [x] ...原创 2013-05-11 21:15:08 · 76 阅读 · 0 评论 -
haskell - Monads - the list monad
in this post, we will going to examine the list a monad, first let's see what is the definition of the list monad, here is the definition of the instance Monad [] where return x = [x] ...原创 2013-05-11 20:11:53 · 123 阅读 · 0 评论 -
haskell - Monads - the do monad
In this post, we will examine the do monad haskell... Monads in Haskell are so useful that they got their own special syntax called do notation. Its principle is still the same: gluing together ...原创 2013-05-11 14:08:05 · 102 阅读 · 0 评论 -
haskell - Monads - ramp up with Monad
Fist we shall answer the question of what is Monad, monad are just beefed up applicative functors, much like applicative functors are only beefed up functors. so, let's recall monad, and its pre...原创 2013-05-09 22:26:55 · 105 阅读 · 0 评论 -
haskell - Functors, Applicative Functors and Monoids - Monoids application
we have introduced monoids before, and in this post, we will continue to examine the usage of monoids, we will continue this post with introduction on the some datascture implemented with monoids, s...原创 2013-05-01 23:00:20 · 81 阅读 · 0 评论 -
haskell - Functors, Applicative Functors and Monoids - Monoids introduction
In this post, we will going to examine the monoid, monoids are a typeclass, which has an associative binary function and a value which acts as an identity with respect to that function. Before ...原创 2013-05-01 22:57:31 · 91 阅读 · 0 评论 -
haskell - Functors, Applicative Functors and Monoids - types/newtypes/data
It is because the difference between type/newtype/data always confuses than clearifies people, so it worth to make a dedicated section on their differences. so most of this chapter will be narra...原创 2013-05-01 22:53:03 · 106 阅读 · 0 评论 -
haskell - few more monad - Reader Monad
we have seen before the (->) r is an instance of functor, and we can do things like this : this basically allow us to do the fmap function mapping. ghci> let f = (*5) ghci> let g = (...原创 2013-05-12 20:08:11 · 105 阅读 · 0 评论 -
haskell - few more monad - stateful computation
Haskell is a pure - in another word, a stateless computation, where a program makde of cuntions that can't change any global any global state or variabble, they can only do some computations and ret...原创 2013-05-13 22:49:04 · 101 阅读 · 0 评论 -
haskell - load and unload modules
in haskell, you can dynamicall add or unload modules in the ghci interactive command prompt. Load modulePrelude> import Data.MapPrelude Data.Map> or Prelude> :m +Data.MapPrelu...原创 2013-04-03 16:55:07 · 271 阅读 · 0 评论 -
haskell - interactive evaluation at the prompt
Like most other language, haskell also has an interative prompt where you use repl way to quickly run and test your code. however, since haskell do no thave the statement ending sign such as the ; w...原创 2013-04-02 19:04:25 · 126 阅读 · 0 评论