On Thu, 2010-12-23 at 14:15 +0800, Magicloud Magiclouds wrote:
On Thu, Dec 23, 2010 at 2:01 PM, Mark Lentczner ma...@glyphic.com wrote:
On Dec 22, 2010, at 9:29 PM, Magicloud Magiclouds wrote:
Thus under all situation (ascii, UTF-8, or even
UTF-32), my program always send 4 bytes through
Hi,
For those who remember the discussion about this about a year ago, it turns out
there was a simpler version after all lurking somewhere in there (or is it
_out_?).
I've just posted it to the haskellwiki's Prime Numbers page:
primes = 2: primes'
where
primes' = 3: 5: [7,9..]
On 22/12/10 19:17, John Smith wrote:
On 22/12/2010 19:03, Simon Marlow wrote:
On 14/12/2010 08:35, Isaac Dupree wrote:
On 12/14/10 03:13, John Smith wrote:
I would like to formally propose that Monad become a subclass of
Applicative, with a call for consensus by 1 February. The change is
The page
http://www.haskell.org/haskellwiki/Yet_Another_Haskell_Tutorial
says that there is a darcs repository at
http://darcs.haskell.org/yaht/
but it is not. Also in the canonical replacement location
http://code.haskell.org/yaht/
I cannot find it.
The Wikiboook
On 23 December 2010 05:29, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
If so, OK, then I think I could make a packInt which turns an Int
into 4 Word8 first. Thus under all situation (ascii, UTF-8, or even
UTF-32), my program always send 4 bytes through the network. Is that
OK?
Lately I've been seeing this error occasionally when recompiling:
Undefined symbols:
_UiziTrackC_d26DB, referenced from:
_UiziTrackC_d26DB$non_lazy_ptr in TrackC.o
ld: symbol(s) not found
If I delete the .o file for the mentioned module and recompile, it
links fine. This makes me think
On Thu, Dec 23, 2010 at 1:01 AM, Evan Laforge qdun...@gmail.com wrote:
So, my current options are either figure out some way to speed up
parsec3+Text, revert to parsec2+String and give up, or try an entirely
different parsing library. I've heard attoparsec is fast but I'd have
to switch to
On Dec 21, 2010, at 6:57 PM, austin seipp wrote:
https://gist.github.com/750279
I took Austins code and modified it to run on a Tree GADT which is
parameterized by its shape:
https://gist.github.com/752982
Would this count as a function mirror with proof that mirror (mirror x) == x?
--
Hello all, sorry I must have taken my stupid pills this morning, I cannot
get the following code to compile, what am I missing?
data MyState=MyState Integer
newState:: (RandomGen g) = RandT g IO MyState
newState = do
time-liftIO getCPUTime
rand-getRandomR (1,6)
return $
On 22/12/2010 19:03, Simon Marlow wrote:
On 14/12/2010 08:35, Isaac Dupree wrote:
On 12/14/10 03:13, John Smith wrote:
I would like to formally propose that Monad become a subclass of
Applicative, with a call for consensus by 1 February. The change is
described on the wiki at
On Thursday 23 December 2010 15:52:40, JP Moresmau wrote:
Hello all, sorry I must have taken my stupid pills this morning, I
cannot get the following code to compile, what am I missing?
Works here.
Which versions of the packages and GHC are you using?
On Thursday 23 December 2010 15:52:40, JP Moresmau wrote:
what am I missing?
Maybe I just spotted it:
But the MonadRandom docs say:
Instances:
MonadIOhttp://hackage.haskell.org/packages/archive/transformers/0.2.2.0/doc/html/Control-
Monad-IO-Class.html#t:MonadIO m
links to the
GHC 6.12.1, base 4.2.0.0, MonadRandom-0.1.6, transformers-0..2.2.0, on
Windows.Could it be that my system is not picking up the MonadIO I think it
does?
JP
On Thu, Dec 23, 2010 at 4:13 PM, Daniel Fischer
daniel.is.fisc...@googlemail.com wrote:
On Thursday 23 December 2010 15:52:40, JP
On Thursday 23 December 2010 16:21:05, JP Moresmau wrote:
GHC 6.12.1, base 4.2.0.0, MonadRandom-0.1.6, transformers-0..2.2.0, on
Windows.
Could it be that my system is not picking up the MonadIO I think it does?
Probably. With 6.12.1, you'll probably have an mtl-1.* installed, so the
Thanks a million, it worked! Following all the dependencies sometimes is a
bit of a headache. But in a sense, I'm happy to see I had understood how to
use the monad transformer correctly, it wasn't me being (too) stupid. Thanks
again!
JP
On Thu, Dec 23, 2010 at 4:32 PM, Daniel Fischer
I think it's pretty legit. You aren't actually making a claim about the
values in the tree but I think parametricity handles that for you,
especially since you have existential types for the payload at every tree
level (so you can't go shuffling those around).
The only thing missing (and that you
On Thu, Dec 23, 2010 at 3:03 PM, Felipe Almeida Lessa
felipe.le...@gmail.com wrote:
Michael Snoyman wants attoparsec-text as well [1].
[1] http://docs.yesodweb.com/blog/wishlist/
It's on my Christmas wishlist too.
Johan
___
Haskell-Cafe mailing
On Thu, Dec 23, 2010 at 6:21 PM, Johan Tibell johan.tib...@gmail.com wrote:
On Thu, Dec 23, 2010 at 3:03 PM, Felipe Almeida Lessa
felipe.le...@gmail.com wrote:
Michael Snoyman wants attoparsec-text as well [1].
[1] http://docs.yesodweb.com/blog/wishlist/
It's on my Christmas wishlist too.
Haha, not exactly.
You can replace
sj - get
let (a, sk) = runState something sj
put sk
with
a - something
Also, you don't need do notation for single statements; do return x is
just return x
On Wed, Dec 22, 2010 at 7:21 PM, michael rice nowg...@yahoo.com wrote:
Thanks for the tip, Ozgur.
Hi all,
Here's my attempt to convert a list of integers to a list of range tuples -
Given [1,2,3,6,8,9,10], I need [(1,3),(6,6),8,10)]
My attempt using foldl yields me the output in reverse. I can ofcourse
reverse the result, but what would be a better way?
f xs = foldl ff [] xs
where
On Thu, Dec 23, 2010 at 8:19 AM, Daniel Peebles pumpkin...@gmail.com wrote:
Simulating bottoms wouldn't be too hard, but I don't think the statement is
even true in the presence of bottoms, is it?
Isn't it?
data Tree a = Tip | Node (Tree a) a (Tree a)
mirror :: Tree a - Tree a
mirror Tip =
On Tue, Dec 21, 2010 at 9:57 AM, austin seipp a...@hacks.yi.org wrote:
For amusement, I went ahead and actually implemented 'Mirror' as a
type family, and used a little bit of hackery thanks to GHC to prove
that indeed, 'mirror x (mirror x) = x' since with a type family we can
express 'mirror'
On Thursday 23 December 2010 18:27:43, C K Kashyap wrote:
Hi all,
Here's my attempt to convert a list of integers to a list of range
tuples -
Given [1,2,3,6,8,9,10], I need [(1,3),(6,6),8,10)]
My attempt using foldl yields me the output in reverse. I can ofcourse
reverse the result, but
Fair enough :) that'll teach me to hypothesize something without thinking
about it! I guess I could amend my coinductive proof:
http://hpaste.org/paste/42516/mirrormirror_with_bottom#p42517
does that cover bottom-ness adequately? I can't say I've thought through it
terribly carefully.
On Thu,
On Thu, 23 Dec 2010, C K Kashyap wrote:
Here's my attempt to convert a list of integers to a list of range tuples -
Given [1,2,3,6,8,9,10], I need [(1,3),(6,6),8,10)]
That's an interesting problem!
My first attempt:
List.unfoldr (\xs - case xs of [] - Nothing; y:ys - case span (uncurry
On Thu, 23 Dec 2010, Daniel Fischer wrote:
On Thursday 23 December 2010 18:27:43, C K Kashyap wrote:
Hi all,
Here's my attempt to convert a list of integers to a list of range
tuples -
Given [1,2,3,6,8,9,10], I need [(1,3),(6,6),8,10)]
My attempt using foldl yields me the output in
On Thursday 23 December 2010 18:27:43, C K Kashyap wrote:
Hi all,
Here's my attempt to convert a list of integers to a list of range
tuples -
Given [1,2,3,6,8,9,10], I need [(1,3),(6,6),8,10)]
My attempt using foldl yields me the output in reverse. I can ofcourse
reverse the result, but
On Thursday 23 December 2010 12:52:07 pm Daniel Peebles wrote:
Fair enough :) that'll teach me to hypothesize something without thinking
about it! I guess I could amend my coinductive proof:
http://hpaste.org/paste/42516/mirrormirror_with_bottom#p42517
does that cover bottom-ness
On Thu, Dec 23, 2010 at 10:57:43PM +0530, C K Kashyap wrote:
Here's my attempt to convert a list of integers to a list of range tuples -
Given [1,2,3,6,8,9,10], I need [(1,3),(6,6),8,10)]
import Data.Function
import Data.List
ranges ns =
[(head gp, last gp) |
gp - map
I'd go with direct recursion for this one - the pattern of consumption
and production that generates the answer doesn't seem to neatly match
any of the standard recursion combinators (map, unfold, fold,
mapAccum, ...) nor exotic ones (skipping streams c.f. the Stream
fusion paper, apomorphisms,
fromList :: [a] - SignalGen (Signal a)
fromList xs =
stateful xs tail = memo . fmap head
1) It does what I want, but is it the good way to do it?
Yes, I'd do it the same way, assuming that the input is always an
infinite list (so this version should probably be called
unsafeFromList...).
Why are Cofunctor and Comonad classes not a part of the base library?
I recently defined a data type (Control.Cofunctor.Ticker in
monad-coroutine on Hackage) that happens to be a co-functor, or
contra-functor if you prefer. In other words, it can implement the
following function:
cofmap ::
On 23 December 2010 21:12, Stephen Tetley stephen.tet...@gmail.com wrote:
I'd go with direct recursion for this one - the pattern of consumption
and production that generates the answer doesn't seem to neatly match
any of the standard recursion combinators (map, unfold, fold,
mapAccum, ...)
On Thu, 23 Dec 2010, Stephen Tetley wrote:
On 23 December 2010 21:12, Stephen Tetley stephen.tet...@gmail.com wrote:
I'd go with direct recursion for this one - the pattern of consumption
and production that generates the answer doesn't seem to neatly match
any of the standard recursion
On 23 December 2010 22:01, Henning Thielemann
lemm...@henning-thielemann.de wrote:
This could be seen as type Step st a = (Maybe a, st). I have thought about
mapping from [Int] to [Maybe (Int, Int)] by mapAccumL, then compressing the
result with catMaybes. However we need to append a final
On 23 December 2010 21:43, Mario Blažević mblaze...@stilo.com wrote:
Why are Cofunctor and Comonad classes not a part of the base library?
[SNIP]
Later on I found that this question has been raised before by Conal Elliott,
nearly four years ago.
Thanks for your answers. In fact I tried to use Simple with a clock signal
and it's painful to pass it wherever you need it. Param is much more
practical.
I like Elerea, I tried Reactive and Yampa, and I found them (especially
Yampa) heavy and not very practical.
The fact that Elerea is
Mark Lentczner and I are organizing, and it will be held at Hacker Dojo in
Mountain
Viewhttp://maps.google.com/maps/place?cid=2122486601784397611q=hacker+dojogl=us
.
If you plan to attend, please fill in our sign-up
This one looks somewhat symmetrical:
f xs =
let xys = filter ( \ (x,y) - y - x 1 )
$ zip xs ( tail xs )
in zip ( [ head xs ] ++ map snd xys )
( map fst xys ++ [ last xs ] )
___
Haskell-Cafe mailing list
All the previous solutions seem to assume that the list of numbers is already
sorted. In cases where this assumption cannot be made, an alternative solution
is to simply insert the numbers into a diet.
eecs.oregonstate.edu/~erwig/papers/abstracts.html#JFP98
On Thu, Dec 23, 2010 at 5:25 PM, Stephen Tetley stephen.tet...@gmail.comwrote:
On 23 December 2010 21:43, Mario Blažević mblaze...@stilo.com wrote:
Why are Cofunctor and Comonad classes not a part of the base library?
[SNIP]
Later on I found that this question has been raised before by
I'm happy to announce a new relase of xmobar, the text-based monitor
bar. You can read everything about xmobar and this release at our new
web address (http://projects.haskell.org/xmobar/), or see below for a
summary of what's new (cf.
http://projects.haskell.org/xmobar/releases.html).
##
For me, mostly naming. Cofunctor isn't the right name for it, and comap,
while short, feels wrong. Contrafunctor feels better but is also cumbersome.
No problems with Comonad, though.
On Thu, Dec 23, 2010 at 9:16 PM, Mario Blažević mblaze...@stilo.com wrote:
On Thu, Dec 23, 2010 at 5:25 PM,
On Thu, Dec 23, 2010 at 5:25 PM, Stephen Tetley
stephen.tet...@gmail.com wrote:
On 23 December 2010 21:43, Mario Blažević mblaze...@stilo.com wrote:
Why are Cofunctor and Comonad classes not a part of the base library?
[SNIP]
Later on I found that this question has been raised before by Conal
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
...regardless of the utility of a contravariant functor type-class, I
strongly advocate for calling it Contrafunctor and not Cofunctor. I
have seen numerous examples of confusion over this, particularly in
other languages.
On 24/12/10 12:16, Mario
On Thu, Dec 23, 2010 at 11:25 PM, Tony Morris tonymor...@gmail.com wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
...regardless of the utility of a contravariant functor type-class, I
strongly advocate for calling it Contrafunctor and not Cofunctor. I
have seen numerous examples of
On 12/23/10 16:43, Mario Blažević wrote:
Cofunctor and Comonad
IMHO, as you say, there is only one design of cofunctor.
class Cofunctor cf where
cofmap :: (a - b) - cf b - cf a
The only question is capitalization and spelling.*
Since there are multiple designs of Comonad floating around,
On Thu, Dec 23, 2010 at 11:46 PM, Mario Blažević mblaze...@stilo.com wrote:
I don't personally care what's it called, as long as it's available. Can
anybody point to an authoritative source for the terminology, though?
Wikipedia claims that cofunctor is a contravariant functor.
Does nLab
...I mean, storable-endian 0.2.1 actually - 0.2.0 had a stupid bug.
2010/12/24 Eugene Kirpichov ekirpic...@gmail.com:
Hello Hennig,
Thanks for the suggestions!
I've released storable-endian 0.2.0, which does not use TH and bases
on your suggestion (though it has a bit of boilerplate because
Hello Hennig,
Thanks for the suggestions!
I've released storable-endian 0.2.0, which does not use TH and bases
on your suggestion (though it has a bit of boilerplate because of
abandoning TH, but I don't think that's critical).
Here's the new source:
50 matches
Mail list logo