At 2:53 PM -0800 2/18/10, Yves Parès wrote:
Ben Franksen wrote:
You can leave them unsafe if you are sure that
1) they do not call (back) any function in your program
2) they do not block (or not long enough that it bothers you)
Otherwise they are no less safe that the safe calls. If (1) is
Sorry I start spin-off of thread but all over the haskell code is idiom:
throwErrorIfMinus1_ $ someCode args
However this code is dependent on errno, which is thread dependent. Is
GHC making sure that errno set from C call is propagated back into
correct thread?
Are there any requirements
The other day, I found myself writing the following code:
data Property x y = forall s. Property s (x - s - s) (s - y)
step :: x - Property x y - Property x y
step x (Property s f g) = Property (f x s) f g
read :: Property x y - y
read (Property s _ g) = g s
pure :: (x - y) - Property x y
On Sat, Feb 20, 2010 at 3:30 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
Have I just invented arrows?
No... you have a data type which is *an* Arrow (probably/almost). The
pure implementation bugs me because of its use of undefined. Might
still be okay though. I would be more
I just discovered the highly useful function Data.Function.on. I vaguely
recall a few people muttering a couple of years back that this would be
a useful thing to have, but I had no idea it was in the standard
libraries now.
Anyway, while using it, I discovered a small omission from the
Am Samstag, den 20.02.2010, 10:47 + schrieb Andrew Coppin:
I just discovered the highly useful function Data.Function.on. I vaguely
recall a few people muttering a couple of years back that this would be
a useful thing to have, but I had no idea it was in the standard
libraries now.
Also, constructions like
sortBy (compare `on` foo)
must surely be very common.
Just as a data point: I use constructions like the above very often.
(Perhaps someone more enlightened than me can point out the connection
to arrows?)
Data.Function.on is surprisingly useful in some other
Luke Palmer wrote:
On Sat, Feb 20, 2010 at 3:30 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
Have I just invented arrows?
No... you have a data type which is *an* Arrow (probably/almost).
Well, OK, that's kind of what I meant. ;-)
The
pure implementation bugs me because of
On 19/02/10 22:31, Don Stewart wrote:
paul:
I'd like to use this kind of graph at work as evidence that Haskell is
on a growth trajectory.
You might be more interested in data from Hackage:
http://www.galois.com/blog/2009/03/23/one-million-haskell-downloads/
runched when we
Anyway, for yours: try to implement (.) :: Property b c - Property a
b - Property a c, and first :: Property a b - Property (a,c) (b,c).
Then you will have an arrow.
(.) = flip (==)
first p = p == pure id
No, not quite.
\p - p == pure id :: Property a b - Property a (b, a)
What you
Hi Andrew
Spot the difference
data Property x y = forall s. Property s (x - s - s) (s - y)
data Fold b c = forall a. F (a - b - a) a (a - c)
The later is from:
http://squing.blogspot.com/2008/11/beautiful-folding.html
Max Rabkin's is is closer to the original argument ordering of foldl.
Best
Dean Herington wrote:
Careful. If you're calling foreign functions
that rely on thread-local storage, you must call
them using the same OS thread (to provide them
with the correct thread state), which means using
the same, *bound*, Haskell thread. It wouldn't
work to call them from both the
Stephen Tetley wrote:
Hi Andrew
Spot the difference
data Property x y = forall s. Property s (x - s - s) (s - y)
data Fold b c = forall a. F (a - b - a) a (a - c)
The later is from:
http://squing.blogspot.com/2008/11/beautiful-folding.html
Max Rabkin's is is closer to the original argument
On Sat, Feb 20, 2010 at 9:10 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
PS. Epic, epic comment spam.
Yeah, sorry. Every now and again I decide I should deal with it. Then
I rediscover that it takes about four clicks to delete each comment.
Basically, I leave my blog alone until I have
I can't answer your question (about getting minBy into the libraries)
but I thought I'd point out some tricks:
On Sat, Feb 20, 2010 at 10:47 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
Also, constructions like
sortBy (compare `on` foo)
must surely be very common.
Common enough
Ben Millwood wrote:
I can't answer your question (about getting minBy into the libraries)
but I thought I'd point out some tricks:
On Sat, Feb 20, 2010 at 10:47 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
Also, constructions like
sortBy (compare `on` foo)
must surely be very
Hi,
Ben Franksen benjamin.frank...@bessy.de writes:
This rc release is still notably slower on some operations than older
releases. My test case is a large project named RTEMS (a real-time OS),
that we wish to import into darcs (at work) to better track our own
additions and modifications.
Am Samstag 20 Februar 2010 13:39:24 schrieb Ben Millwood:
a technique which I believe is called a Schwarzian transform.
Schwartzian transform, with a tz. After Randal L. Schwartz.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello,
I am happy to announce HaskellTorrent v0.0, a concurrent bittorrent client.
The current release is a rather early preview release: it can download torrents
and seed them, but currently there are many optimizations and tweaks needed
before it is ready for day-to-day use. In particular, we
Hi all,
I want restricted categories, just like the rmonad package provides restricted
monads. The ultimate goal is to have a product category:
http://en.wikipedia.org/wiki/Product_category
{-# LANGUAGE TypeOperators, TypeFamilies, MultiParamTypeClasses,
FlexibleInstances, FlexibleContexts,
A place in the hall of fame and thank you for mentioning clopen... ;-)
Just wanting to present open/closed as and example of improvable maths
terminology, I oversaw this even more evident defect in it and even
copied it into my improvement proposal, bordered/unbordered:
It is questionable
Richard O'Keefe wrote:
On Feb 19, 2010, at 2:48 PM, Nick Rudnick wrote:
Please tell me the aspect you feel uneasy with, and please give me
your opinion, whether (in case of accepting this) you would rather
choose to consider Human as referrer and Int as referee of the
opposite -- for I think
Alexander Solla wrote:
So, the type (View view) -- ignoring class instances -- is basically
isomorphic to this (slightly simpler) type:
data View = EmptyView | TextView String | ConcatView View View |
NestViews View View View | ...
instance Monoid View where ...
Now, consider the
On Feb 20, 2010, at 10:29 AM, Sjoerd Visscher wrote:
I don't understand this, as I thought the constraints the error is
complaining about is just what withConstraintsOf g should provide.
I guess there's something about the Suitable trick that I don't
understand, or possibly the type
On Fri, Feb 19, 2010 at 10:42 PM, wren ng thornton w...@freegeek.org wrote:
Sean Leather wrote:
The second option approaches the ideal pointfreeness (or pointlessness if
you prefer), but I'd like to go farther:
(...) :: (c - d) - (a - b - c) - a - b - d
(...) f g x y = f (g x y)
infixr 9
A package for type-safe I/O control. Currently only ioctl is supported.
Currently simply a extract from my tuntap fork
TODO:
- Return the integer as well as structure (will break the API)
- Port for Windows Network.Socket.IOCtl (as soon as I manage to setup
some sane environment on this
On Feb 20, 2010, at 10:25 AM, Heinrich Apfelmus wrote:
But isn't the line
renderXHtml (ConcatView l r) = fold $ renderXHtml (ConcatViews l r)
a type error? I'm assuming
Data.Foldable.fold :: (Foldable m, Monoid t) = m t - t
being applied to the result type of renderXHtml which is
Matt Hellige wrote:
Thanks! I'm glad to know that people have found this approach useful.
In cases where it works, I find it somewhat cleaner than families of
combinators with (what I find to be) rather obscure names, or much
worse, impenetrable sections of (.). We can write the original example
Alexander Solla wrote:
You specifically ask withConstraintsOf to accept only Suitable2's when
you say
withConstraintsOf :: Suitable2 m a b = m a b - (Constraints m a b
- k) - k
But you aren't saying that the argument of withConstraintsOf IS a
Suitable2, when you say:
instance (RCategory c1,
On Sat, Feb 20, 2010 at 5:47 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
sortOn :: (Ord y) = (x - y) - [x] - [x]
sortOn foo = sortBy (compare `on` foo)
Incidentally, this function is provided as Data.List.Ordered.sortOn'
in the data-ordlist package...
On Sat, Feb 20, 2010 at
30 matches
Mail list logo