On Sun, Sep 03, 2006 at 01:23:13AM +0200, [EMAIL PROTECTED] wrote:
Tomasz Zielonka:
Programmers define the = method for their monads because they want to
use it to bind computations. They know how to pass result(s) from
one computation in their Monad to another, and they put this algorithm
Hi,
I am a Haskell newbie. Having read some tutorials (Yet Another,
Gentle Introduction) and some papers/tutorials on monads, I would like
to spend some time practicing what I have learned before embarking on
more abstract/obscure things and/or using Haskell for everyday tasks.
I am looking for
Hello Brian,
Saturday, September 2, 2006, 10:19:17 PM, you wrote:
What is the practical difference between class A and class B? With
class A we can define instances so that f is overloaded (Int -
Bool), (String - Bool), (Bool - Bool) by defining instances of A
for Int, String, and Bool, but
Hello Tamas,
Sunday, September 3, 2006, 12:15:48 PM, you wrote:
I am looking for small to medium sized practice problems, preferably
with solutions. Hal Daume's tutorial had some good one-liners (eg
rewrite something point-free) but I am looking for something which
would take 1-3 hours for
On Sun, Sep 03, 2006 at 12:47:45PM +0400, Bulat Ziganshin wrote:
Hello Tamas,
Sunday, September 3, 2006, 12:15:48 PM, you wrote:
I am looking for small to medium sized practice problems, preferably
with solutions. Hal Daume's tutorial had some good one-liners (eg
rewrite something
Tamas K Papp wrote:
On Sun, Sep 03, 2006 at 12:47:45PM +0400, Bulat Ziganshin wrote:
i also suggest you to start write some library. there is enough
useful libs that are still bnot implemented because lack of time (and
insterest in such simple code) on side of more experienced
programmers. i
Brian Hulley wrote:
Interval llow lhigh + Interval rlow rhigh = Interval (min llow
rlow) (max lhigh rhigh)
Not a good start!!! ;-)
Interval llow lhigh + Interval rlow rhigh =
Interval (llow+rlow) (lhigh+rhigh)
___
Haskell-Cafe mailing list
Well, bind is extracting an 'a'. I clearly see a '\ a - ...'; it
getting an 'a' so it can give that to g. Granted, the extraction is
very convoluted, but it's there.
-- Lennart
On Sep 2, 2006, at 19:44 , Udo Stenzel wrote:
Benjamin Franksen wrote:
Sure. Your definition of bind
On Sep 3, 2006, at 8:22 AM, Brian Hulley wrote:
Tamas K Papp wrote:
On Sun, Sep 03, 2006 at 12:47:45PM +0400, Bulat Ziganshin wrote:
i also suggest you to start write some library. there is enough
useful libs that are still bnot implemented because lack of time
(and
insterest in such
Am Sonntag, 3. September 2006 15:39 schrieb Lennart Augustsson:
Well, bind is extracting an 'a'. I clearly see a '\ a - ...'; it
getting an 'a' so it can give that to g. Granted, the extraction is
very convoluted, but it's there.
-- Lennart
But
instance Monad (Cont r) where
Lennart Augustsson wrote:
Well, bind is extracting an 'a'. I clearly see a '\ a - ...'; it
getting an 'a' so it can give that to g. Granted, the extraction is
very convoluted, but it's there.
Oh, that can be remedied...
m = g = m . flip g
In fact, why even mention m?
(=) = (. flip)
Brian Hulley [EMAIL PROTECTED] wrote:
What about a library for interval arithmetic [1]?
I'd imagine it could start something like:
data Interval a = Interval !a !a deriving (Eq, Show)
instance Num a = Num (Interval a) where
Interval llow lhigh + Interval rlow rhigh = Interval
Hello,
after succeeding in implementing my first monad (Counter, it increments
a counter every time a computation is performed) I though I'd try
another one and went on to implement Tracker.
Tracker is a monad where a list consisting of the result of every
computation is kept alongside the final
On 9/3/06, Julien Oster [EMAIL PROTECTED] wrote:
Hello,
Hi.
Why does the interpreter infer Tracker a a instead of the more general
Tracker a c?
The problem is that you're trying to keep a list of all computations
performed, and lists can only store values of one uniform type. So, if
you
Dan Doel wrote:
Thus, unfortunately, you won't be able to implement the general bind
operator. To do so, you'd need to have Tracker use a list that can
store values of heterogeneous types, which is an entire library unto
itself (HList).
Telling me that it just won't work was one of the best
Now if anyone could enlighten me about the instance Monad Tracker a
instead of instance Monad Tracker part, everything will be clear!
A Monad always takes one type argument -- the a in IO a, Maybe a, etc.
So Tracker can't be a Monad (it needs two arguments), but (Tracker a)
is, for any a.
Hi -
I'm not sure if this is the right place to ask this question but since a lot
of Haskell code is under the BSD license I think the answer could be useful
for other people as well.
The question I have is if I want to redistribute a binary executable under
my own proprietary license that
Julien Oster wrote:
Now if anyone could enlighten me about the instance Monad Tracker a
instead of instance Monad Tracker part, everything will be clear!
Hello Julien,
The way you defined it, Tracker is a type constructor with two arguments,
both of which are types; another way to state this
Benjamin Franksen wrote:
Partially applying Tracker to one argument ('T a') gives you a type
constructor that has only one remaining 'open' argument and thus can be
made an instance of class Monad.
Totally clear, thanks a lot (also to Keegan).
Julien
Paul Johnson wrote:
Brian Hulley [EMAIL PROTECTED] wrote:
What about a library for interval arithmetic [1]?
[Interval 5 5] / [Interval -1 1] = [FromNegInfinityTo -5,
ToPosInfinityFrom 5]
Take a look at my Ranged Sets library at
http://sourceforge.net/projects/ranged-sets
Hi Paul
Hi -
There's lots of great Haskell libraries available, but little
standardization regarding naming conventions or code organization. In this
post I try to illustrate some dimensions of the question of how to form
names for things and offer my opinion on specific examples knowing that this
of
G'day all.
Quoting Benjamin Franksen [EMAIL PROTECTED]:
As we all know, the monadic bind operation has type:
bind :: Monad m = m a - (a - m b) - m b
My intuition says that in order to apply the second argument to some
non-trivial (i.e. non-bottom) value of type a, the bind operator
You are right, but I was using extraction in a rather non-technical
sense.
Look at it this way: we have 'x = f', let's assume it's the
continuation monad. Assuming f has type 'a - C b' we must have
something of type a to be able to call the function be at all.
Somehow = is able make sure
23 matches
Mail list logo