On 2009-09-30 21:27 +0200 (Wed), Alberto G. Corona wrote:
> > Do you really want, in 2020, to look back at the 2010 revision of the
> > Haskell standard and think, "we entrenched things that for a decade
> > everybody agreed was dumb"?
>
> I see no problem in haskell having both. experimental an
On Tue, Sep 29, 2009 at 9:35 PM, Jonathan Daugherty wrote:
> vty-ui is:
>
> An extensible library of user interface widgets for composing and
> laying out Vty user interfaces. This library provides a collection of
> widgets and a type class for rendering widgets to Vty Images.
Cool! I'll be sure
Oops...forgot the footnote. The lexical syntax part of the report is
at http://haskell.org/onlinereport/lexemes.html.
Alex
On Wed, Sep 30, 2009 at 7:56 PM, Alexander Dunlap
wrote:
> Comments are started with "--" followed by a character that is not a
> symbol character. If it is followed by a sy
wren ng thornton wrote:
I guess one could make rules for that, but this tickets makes me
wander if
that really works:
http://hackage.haskell.org/trac/ghc/ticket/1434
The RealToFrac class solves Henning's performance complaint as well.
Er, I misread his performance problems. The logfloat pa
Peter Verswyvelen wrote:
I don't want to use the GL types directly since the OpenGL renderer is not
exposes in the rest of the API.
I was hoping that realToFrac would be a nop in case it would be identical to
an unsafeCoerce.
This is one of the areas where the H98 spec is broken. Not only is th
I had a question about onException & friends: what's the rationale
for having:
(error "foo") `onException` (error "bar")
give bar and not foo? I.e. why does an exception raised during
exception handling get propagated past the exception that triggered
the handler?
Most examples I can think for e
On Wed, Sep 30, 2009 at 11:10:19PM -0400, John Dorsey wrote:
> > Well, try this: Go ask a random person how you add up a list of numbers.
> > Most of them will say something about adding the first two together,
> > adding the third to that total, and so forth. In other words, the step
> > by
OK, I got it to work with gread/gshow.
However I have noticed this:
*Main> (gread $ gshow $ FuncExpr 0 [] (EmptyStmt 0)) :: [(Expression
Int, String)]
[(FuncExpr 0 [] (EmptyStmt 0),"")]
vs.
*Main> (gread $ gshow $ FuncExpr () [] (EmptyStmt ())) :: [(Expression
(), String)]
[]
Or even narrower:
> Well, try this: Go ask a random person how you add up a list of numbers.
> Most of them will say something about adding the first two together,
> adding the third to that total, and so forth. In other words, the step
> by step instructions.
You word the (hypothetical) question with a bias
i got annoyed with Parsec and wrote a much more boring parser which
allows me to parse anything with any kind of matching i want. Its
basically a combination of State and Error monads.
So i can use a grep like parser that matches via a regular expression
over a list of lines
grep re = do
vv::B
Comments are started with "--" followed by a character that is not a
symbol character. If it is followed by a symbol character (e.g. "*")
then the "--" plus the symbol (e.g. "--*") parses as an operator
rather than a comment. "p" is not a symbol, so the "--" starts a
comment.
For a precise descrip
Nowhere any Haskell book mentioned "line comments start with "-- ", not just
"--"." It is just people usually put "-- " ahead of comments.
I can successfully compile "--print bla bla bla."
On Wed, Sep 30, 2009 at 7:36 PM, Sebastian Sylvan <
sebastian.syl...@gmail.com> wrote:
>
>
> On Thu, Oct 1
But in my program, I did not define "--++".
Also in GHCI,
Prelude> :t (--++)
No in scope: '--++'
Prelude> :t (+)
(+) :: (Num a) => a -> a -> a
Thanks,
Hong
On Wed, Sep 30, 2009 at 7:05 PM, Daniel Peebles wrote:
> I don't think it's a bug. --++ is a valid operator, whereas --
> introduces a com
On Wed, Sep 30, 2009 at 03:43:12PM +0100, Andrew Coppin wrote:
> Well, try this: Go ask a random person how you add up a list of
> numbers. Most of them will say something about adding the first two
> together, adding the third to that total, and so forth. In other
> words, the step by step instruc
On 2009-10-01 11:42 +1000 (Thu), Tony Morris wrote:
> There is a significant difference between:
>
> * A $ function without a type system
> * A statically checked $ function
> * A $ keyword without static checking
Sure, but I'm not not clear on the point you're trying to make, since we
all know
I wish I had enough of your code to type-check my code and perhaps even
try running it!
Michael Mossey wrote in article
<3942.75.50.175.130.1253997756.squir...@mail.alumni.caltech.edu> in
gmane.comp.lang.haskell.cafe:
> -- This is state used in the state monad.
> data SearchState = SearchState
On 2009-09-30 07:16 -0600 (Wed), John A. De Goes wrote:
> The cross-platform features have been extremely important to the success
> of Java
> Moreover, the importance of cross-platform libraries on the Java
> platform is evinced by the fact that developers of major native
> libraries _a
There is a significant difference between:
* A $ function without a type system
* A statically checked $ function
* A $ keyword without static checking
Curt Sampson wrote:
> On 2009-09-30 13:45 -0300 (Wed), namekuseijin wrote:
>
>
>> The Perl call is spot on. Specially because Haskell has bee
On 2009-09-30 13:45 -0300 (Wed), namekuseijin wrote:
> The Perl call is spot on. Specially because Haskell has been
> incorporating so much syntatic sugar that it's almost looking Perlish
> noise already: [examples deleted]
No, I disagree with your particular examples; they're bog-standard
Haske
On 2009-09-29 13:28 -0700 (Tue), Don Stewart wrote:
> I'd welcome input on how to best present all this -- the Haskell
> Platform gives us a chance to package up the docs in a better format
> for consumption.
Part of the issue is that the Haskell libraries are so different in many
ways that there
On Thu, Oct 1, 2009 at 12:52 AM, Hong Yang wrote:
> Hi,
>
> I got an error if one of lines reads "--++ bla bla bla" where I tried to
> comment, but "-- ++ bla bla bla" (notice the space after "--") is OK.
>
> Do you think this revealed a tiny bug in the GHC compiler (I am using
> Windows Haskell
On Wed, 30 Sep 2009, Jochem Berndsen wrote:
Bulat Ziganshin wrote:
Hello Paul,
Wednesday, September 30, 2009, 1:18:03 PM, you wrote:
I haven't found a function in hackage or in the standard library that
takes a list of booleans (or a list of 0s and 1s, or a tuple of booleans
or 0s and 1s) a
I don't think it's a bug. --++ is a valid operator, whereas --
introduces a comment.
In GHCI:
Prelude> let (--++) = (+) in 5 --++ 6
11
Hope this helps,
Dan
On Wed, Sep 30, 2009 at 7:52 PM, Hong Yang wrote:
> Hi,
>
> I got an error if one of lines reads "--++ bla bla bla" where I tried to
> co
Hi,
I got an error if one of lines reads "--++ bla bla bla" where I tried to
comment, but "-- ++ bla bla bla" (notice the space after "--") is OK.
Do you think this revealed a tiny bug in the GHC compiler (I am using
Windows Haskell Platform 2009.2.0.2)?
Thanks,
Hong
___
Ben schrieb:
> dear haskellers --
>
> i'm trying this question again, in haskell-cafe. i got some responses
> in haskell-beginners but am looking for more guidance. also, i
> understand this functionality is encapsulated in the Workflow module
> in hackage, but i'd like to understand this myself
pat browne-2 wrote:
>
> Hi,
> Does anyone know where there are any Haskell implementations of the the
> River Crossing puzzle (AKA Farmer/Fox/Goose/Grain).
>
Here is an implementation of the similar problem with good explanation (see
PDF): http://web.engr.oregonstate.edu/~erwig/zurg/
It isn't
Duncan Coutts wrote:
> On Wed, 2009-09-30 at 08:36 -0500, John Goerzen wrote:
>> If you want to send me a patch that makes it an option (not mandatory),
>> I would be happy to apply it.
>
> When reviewing it do consider the new Unicode IO library.
>
> http://ghcmutterings.wordpress.com/2009/09/30
On Wed, 2009-09-30 at 08:36 -0500, John Goerzen wrote:
> If you want to send me a patch that makes it an option (not mandatory),
> I would be happy to apply it.
When reviewing it do consider the new Unicode IO library.
http://ghcmutterings.wordpress.com/2009/09/30/heads-up-what-you-need-to-know-a
On Wed, Sep 30, 2009 at 8:32 AM, Andrew Coppin
wrote:
>
>
> (Mr C++ argues that homo sapiens fundamentally think in an imperative way,
> and therefore functional programming in general will never be popular. We
> shall see...)
You could use the same argument against, say, utensils. Being "natural
On Wed, 30/Sep/2009 at 22:21 +0400, Khudyakov Alexey wrote:
> В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал:
> > Hi,
> >
> > I will give a seminar to physicists at USP (Universidade de São Paulo,
> > Brazil) university and they asked me for a good title, something that can
> >
On Wed, 30/Sep/2009 at 22:21 +0400, Khudyakov Alexey wrote:
> В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал:
> > Hi,
> >
> > I will give a seminar to physicists at USP (Universidade de São Paulo,
> > Brazil) university and they asked me for a good title, something that can
> >
On Wed, 30/Sep/2009 at 22:27 +0200, Max Rabkin wrote:
> I am *not* a physicist, but I imagine many physicists know at least
> something of functional analysis, algebra, Lie algebras, etc.
>
> However, when physicists write programs (this is my inference from the
> widespread use of Fortran and the
Good ones! Specially the second, since I will show a real example where
I used Haskell to model a boson condensate. Thanks for the suggestions.
Edgar
On Wed, 30/Sep/2009 at 10:52 -0700, Ted Nyman wrote:
> Some ideas of highly variable quality:
>
> Getting Functional with Physics
> Bosons, Fermio
I am *not* a physicist, but I imagine many physicists know at least
something of functional analysis, algebra, Lie algebras, etc.
However, when physicists write programs (this is my inference from the
widespread use of Fortran and the computational assignments given to
undergraduate students) they
Khudyakov Alexey wrote:
В сообщении от Среда 30 сентября 2009 23:08:02 вы написали:
Yep, sure did. I just hit `reply' assuming haskell-cafe was in the
reply-to. I do that more often than not it seems.
Going back to the OP, what area of physics, and how on earth are you
going to convert year
On Wed, 30 Sep 2009 21:24:11 +0200, you wrote:
>I?m a physicist, so I think they would be attracted by something like
>Haskell: high level physics modelling at Fortran speeds
>
>Haskell: mathematics beyond numerical calculus
>
And,
easier to make use of multi-core machines than threaded Fortr
В сообщении от Среда 30 сентября 2009 23:29:32 Max Rabkin написал:
> On Wed, Sep 30, 2009 at 9:24 PM, Alberto G. Corona
wrote:
> > Haskell: mathematics beyond numerical calculus
>
> I'd imagine most physicists know a fair bit of mathematics beyond
> numerical calculus; what they might not know m
В сообщении от Среда 30 сентября 2009 23:08:02 вы написали:
> Yep, sure did. I just hit `reply' assuming haskell-cafe was in the
> reply-to. I do that more often than not it seems.
> Going back to the OP, what area of physics, and how on earth are you
> going to convert years of fortran users to
>
>
> This reminds me of the whole agent thing -- pretty much dominated by
> Java (e.g., Jade, Jason, Jack) nowadays --, for which I would bet lots
> things are done more straigthforward using Haskell -- especially those parts
> the Java coders are usually proud of... Let's maybe speak of *second
On Wed, Sep 30, 2009 at 9:24 PM, Alberto G. Corona wrote:
> Haskell: mathematics beyond numerical calculus
I'd imagine most physicists know a fair bit of mathematics beyond
numerical calculus; what they might not know much about is
*computation* beyond numerical calculus.
--Max
_
forwarded to the list:
Curt,
Rubi and Pyton came into existencie without their internet libraries, but
they would´nt be popular without them. Although I conffess I don´t know the
history in detail.
Academics is not mainstream.
2009/9/29 Curt Sampson
> On 2009-09-29 13:18 +0200 (Tue), Albert
I would say that pure knowledge is pure and functional. but human planning
and problem solving is imperative because implies sequencing of operations
based on this pure knowledge. haskell express both nicely.
2009/9/30 Andrew Coppin
> Peter Verswyvelen wrote:
>
>> I really doubt people tend to t
I´m a physicist, so I think they would be attracted by something like
Haskell: high level physics modelling at Fortran speeds
Haskell: mathematics beyond numerical calculus
2009/9/30
Hi,
>
> I will give a seminar to physicists at USP (Universidade de São Paulo,
> Brazil) university and they a
Again, i missed to forward the message to the list:
I experince also the drug effect. Evolutionary psychologists would say that,
because it was vital for our survival, since the stone age, we appreciate
any tool powerful enough to solve many problems while at the same time
remain simple. So whene
On Wed, Sep 30, 2009 at 9:54 AM, Peter Verswyvelen wrote:
> I guess this is related to the expression problem.
> Suppose I have a datatype
> data Actor = Ball ... | Paddle ... | Wall ...
> and a function
> move (Ball ...) =
> move (Paddle ...) =
> move (Wall ...) =
> in Haskell one must put Actor
Khudyakov Alexey wrote:
В сообщении от Среда 30 сентября 2009 22:25:14 вы написали:
Khudyakov Alexey wrote:
В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал:
Hi,
I will give a seminar to physicists at USP (Universidade de São Paulo,
Brazil) university and they
reminds me of a well-known story, told to me some years back at cornell:
richard feynman was set to deliver a series of lectures in brazil, and he
spent a good deal of time learning spanish in preparation; that was until a
visting professor from brazil told him he might want to try portuguese
inste
В сообщении от Среда 30 сентября 2009 22:37:52 вы написали:
> Khudyakov Alexey wrote:
> > В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал:
> >> Hi,
> >>
> >> I will give a seminar to physicists at USP (Universidade de São Paulo,
> >> Brazil) university and they asked me for a goo
Khudyakov Alexey wrote:
> В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал:
>> Hi,
>>
>> I will give a seminar to physicists at USP (Universidade de São Paulo,
>> Brazil) university and they asked me for a good title, something that can
>> attract physicists. Anyone has some sugg
Bulat Ziganshin-2 wrote:
>
> sum . zipWith (*) (map (2^) [0..])
>
foldr1 $ \b -> (+b) . (*2)
--
View this message in context:
http://www.nabble.com/convert-a-list-of-booleans-into-Word*-tp25677589p25686400.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
__
В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал:
> Hi,
>
> I will give a seminar to physicists at USP (Universidade de São Paulo,
> Brazil) university and they asked me for a good title, something that can
> attract physicists. Anyone has some suggestions? (Will be a seminar ab
В сообщении от 30 сентября 2009 15:58:40 Jochem Berndsen написал:
> Deniz Dogan wrote:
> > 2009/9/30 Andrew Coppin :
> >> (Mr C++ argues that homo sapiens fundamentally think in an imperative
> >> way, and therefore functional programming in general will never be
> >> popular.
> >
> > Sounds more l
В сообщении от 30 сентября 2009 18:05:28 Peter Verswyvelen написал:
> On Wed, Sep 30, 2009 at 3:56 PM, Kalani Thielen wrote:
> > That might be true, but the calculus and even arithmetic were once
> > considered obscure.
>
> Mmm, to the average student calculus is still very obscure ;-)
>
Really
Hi,
I've been playing with generics in general (pardon the pun) and Uniplate in
particular, and found out that strict data fields somehow derail Uniplate.
Observe:
=== code ===
{-# LANGUAGE DeriveDataTypeable #-}
module Test where
import Data.Generics (Data(..),Typeable(..))
import Data.Generic
Some ideas of highly variable quality:
Getting Functional with Physics
Bosons, Fermions, and Monads? Haskell for Physicists
Purer Programming for Physicists
Use Haskell for Physics, and Say 'C'-You-Later
- ted
On Wed, Sep 30, 2009 at 10:42 AM, wrote:
> Hi,
>
> I will give a seminar to physicis
Hallo,
On 9/30/09, ed...@ymonad.com wrote:
> Hi,
>
> I will give a seminar to physicists at USP (Universidade de São Paulo,
> Brazil) university and they asked me for a good title, something that can
> attract physicists. Anyone has some suggestions? (Will be
> a seminar about the use of Hask
Hi,
I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil)
university and they asked me for a good title, something that can attract
physicists. Anyone has some suggestions? (Will be
a seminar about the use of Haskell to substitute C or Fortran
in a lot of tasks, and how
On Wed, Sep 30, 2009 at 11:45 AM, namekuseijin wrote:
> I've not been following Haskell too much and am completely lost when
> reading code like that. I understand (+1), : and ! but what the hell
> are . and $ for?
Function composition and lowest-precedence function application, respectively.
>
On Wed, Sep 30, 2009 at 8:54 AM, Peter Verswyvelen wrote:
> I guess this is related to the expression problem.
>
Actually, this is exactly the expression problem :)
> Suppose I have a datatype
>
> *data Actor = Ball ... | Paddle ... | Wall ...*
>
> and a function
>
> *move (Ball ...) = *
> *mov
On Wed, Sep 30, 2009 at 6:45 PM, namekuseijin wrote:
> On Mon, Sep 28, 2009 at 11:50 PM, Hong Yang wrote:
> > learn and use. In my humble opinion, Haskell has a lot of libraries, but
> > most of them offer few examples of how to use the modules. In this
> regards,
> > Perl is much much better.
>
On Mon, Sep 28, 2009 at 11:50 PM, Hong Yang wrote:
> learn and use. In my humble opinion, Haskell has a lot of libraries, but
> most of them offer few examples of how to use the modules. In this regards,
> Perl is much much better.
The Perl call is spot on. Specially because Haskell has been
inc
Hi Peter,
sounds to me you want to have a look at "Open Data Types and Open
Functions" by Andres Löh and Ralf Hinze:
http://people.cs.uu.nl/andres/OpenDatatypes.pdf
Cheers,
/Niklas
On Wed, Sep 30, 2009 at 5:54 PM, Peter Verswyvelen wrote:
> I guess this is related to the expression problem.
>
I guess this is related to the expression problem.
Suppose I have a datatype
*data Actor = Ball ... | Paddle ... | Wall ...*
and a function
*move (Ball ...) = *
*move (Paddle ...) = *
*move (Wall ...) = *
in Haskell one must put *Actor* and *move* into a single file.
This is rather cumbersome
gwern0:
> On Mon, Sep 28, 2009 at 11:36 AM, selahaddin
> wrote:
> >
> >
> >
> > Lyndon Maydwell wrote:
> >>
> >>> src/Quaternion.hs:22:27
> >>
> >> This would probably be the place to start.
> >>
> >
> > Ok,I managed to get past the error like this:
> >
> > newMatrix ColumnMajor [realToFrac r00,re
On Wed, Sep 30, 2009 at 7:54 AM, Robert Wills wrote:
> fwiw I found it difficult getting a Haskell installation onto Windows.
> Packages that would 'cabal install' just fine on Linux were much more of a
> pain on Windows. Eventually, I actually found it easiest to cross compile
> to Windows usin
Am Mittwoch 30 September 2009 09:32:08 schrieb Andrew Coppin:
> I might also point out that 90% of all desktop computers run Windows,
> and yet every single C library binding on Hackage fails to compile on
> Windows. That really needs to be fixed.
Contribute your share, switch to Linux or BSD 8-)
I don't want to use the GL types directly since the OpenGL renderer is not
exposes in the rest of the API.
I was hoping that realToFrac would be a nop in case it would be identical to
an unsafeCoerce.
I guess one could make rules for that, but this tickets makes me wander if
that really works:
htt
Sure, but it doesn't mean that because someone uses an imperative way of
counting, that it means people's brains work imperatively all the way.
People tend to talk and communicate a lot in a declarative way no? For
example ask someone that doesn't know programming how he we would make a
paddleball
If you are *really* sure that the runtime representation is the same
you could use usafeCoerce. You could use a small test function for
profiling, something like:
convertGLfloat :: GLfloat -> Float
convertGLFloat = realToFrac
-- convertGLFloat = unsafeCoerce
and toggle between the two (assuming y
fwiw I found it difficult getting a Haskell installation onto Windows.
Packages that would 'cabal install' just fine on Linux were much more of
a pain on Windows. Eventually, I actually found it easiest to cross
compile to Windows using wine:
wine HaskellPlatform-2009.2.0.2-setup.exe
wine ca
On Wed, Sep 30, 2009 at 12:32 AM, Andrew Coppin wrote:
> Casey Hawthorne wrote:
>
>> I read somewhere that for 90% of a wide class of computing problems,
>> you only need 10% of the source code in Haskell, that you would in an
>> imperative language.
>>
>> If this is true, it needs to be pushed.
Peter Verswyvelen wrote:
I really doubt people tend to think in either way. It's not even sure
our thinking can be modeled with computing no?
Well, try this: Go ask a random person how you add up a list of numbers.
Most of them will say something about adding the first two together,
adding th
> I might also point out that 90% of all desktop computers run Windows, and
> yet every single C library binding on Hackage fails to compile on
> Windows. That really needs to be fixed.
Luckily, this is being fixed ... by the Free Software movement.
Stefan
_
On Mon, Sep 28, 2009 at 11:36 AM, selahaddin
wrote:
>
>
>
> Lyndon Maydwell wrote:
>>
>>> src/Quaternion.hs:22:27
>>
>> This would probably be the place to start.
>>
>
> Ok,I managed to get past the error like this:
>
> newMatrix ColumnMajor [realToFrac r00,realToFrac r01,realToFrac
> r02,realToFr
Very fast for long boolean lists by using a strict foldl and reversing
the input:
bsToInt :: [Bool] -> Integer
bsToInt = foldl' ((.fromIntegral.fromEnum).(+).join(+)) 0. reverse
Try this:
(>1) $ bsToInt $ take 10 $ cycle [True,True,False,True,True,False,True]
>> bitsToInt :: [Bool] -> Int
Bulat,
OK, gread/gshow seem to be like the basis primitives. If they work
properly, then it is what is needed.
Thanks.
On 9/30/09, Bulat Ziganshin wrote:
> Hello Max,
>
> Wednesday, September 30, 2009, 5:53:37 PM, you wrote:
>
> afaik, SYB just provides gshow/gread functions what serialize any
Hello Max,
Wednesday, September 30, 2009, 5:53:37 PM, you wrote:
afaik, SYB just provides gshow/gread functions what serialize any Data
instance to String
> FWIW, writing your own is not hard. I wrote a serializer for GHC using
> Data in less than 150 (simple) LOC. It produces [Word8], but produ
Mmm, to the average student calculus is still very obscure ;-)
On Wed, Sep 30, 2009 at 3:56 PM, Kalani Thielen wrote:
> > As one C++ expert I know is fond of telling me, "Haskell will only
> > become popular when obscure mathematics becomes popular".
> That might be true, but the calculus and ev
> As one C++ expert I know is fond of telling me, "Haskell will only
> become popular when obscure mathematics becomes popular".
That might be true, but the calculus and even arithmetic were once considered
obscure.
___
Haskell-Cafe mailing list
Haskell
The newest package seems to require using GLdouble/GLfloat.
What is the most efficient way to convert Double/Float to GLdouble/GLfloat?
I'm currently using realToFrac. But essentially the operation should be a
nop on my machine.
I haven't looked at the core code yet (on Windows, last time I check
I think
instance Bar (Ret c) => Foo c where
...
will do what you are asking.
Alex
On Tue, Sep 29, 2009 at 10:25 PM, DNM wrote:
>
> Dan, thanks again for the response.
>
> I changed my code to use type families to let each Cls instance (actually a
> more complicated instance in my code) deter
FWIW, writing your own is not hard. I wrote a serializer for GHC using
Data in less than 150 (simple) LOC. It produces [Word8], but producing
strings instead would be easy. You can check out the code here:
http://darcs.haskell.org/ghc/compiler/utils/Serialized.hs
Cheers,
Max
2009/9/30 Dimitry Go
...Or let's fuse it.
sum . zipWith ((*).(2^)) [0..]
2009/9/30 Jochem Berndsen :
> Bulat Ziganshin wrote:
>> Hello Paul,
>>
>> Wednesday, September 30, 2009, 1:18:03 PM, you wrote:
>>
>>> I haven't found a function in hackage or in the standard library that
>>> takes a list of booleans (or a list o
Bulat Ziganshin wrote:
> Hello Paul,
>
> Wednesday, September 30, 2009, 1:18:03 PM, you wrote:
>
>> I haven't found a function in hackage or in the standard library that
>> takes a list of booleans (or a list of 0s and 1s, or a tuple of booleans
>> or 0s and 1s) and outputs a Word8 or Word32.
>
> s
Hello Paul,
Wednesday, September 30, 2009, 1:18:03 PM, you wrote:
> I haven't found a function in hackage or in the standard library that
> takes a list of booleans (or a list of 0s and 1s, or a tuple of booleans
> or 0s and 1s) and outputs a Word8 or Word32.
sum . zipWith (*) (map (2^) [0..])
If you want to send me a patch that makes it an option (not mandatory),
I would be happy to apply it.
-- John
Antoine Latter wrote:
> Forwarding on to the maintainer, in case he's not on the list.
>
>
> -- Forwarded message --
> From: Sean McLaughlin
> Date: Tue, Sep 29, 2009 a
I really doubt people tend to think in either way. It's not even sure our
thinking can be modeled with computing no?
On Wed, Sep 30, 2009 at 1:58 PM, Jochem Berndsen wrote:
> Deniz Dogan wrote:
> > 2009/9/30 Andrew Coppin :
> >> (Mr C++ argues that homo sapiens fundamentally think in an imperativ
Thanks for the answers. I already had a look at Binary but, as said
above, it doesn't support bit manipulation, only bytes.
On Wed, Sep 30, 2009 at 11:18:03AM +0200, paul.brau...@loria.fr wrote:
> Hello,
>
> I haven't found a function in hackage or in the standard library that
> takes a list of
Hi,
On 9/30/09, Jason Dagit wrote:
[skip]
> Seems like using withList is wrong or the deserializer is simply buggy. It
> certainly doesn't work the way I would expect SExp reading to work. I also
> notice from reading the source on hackage that there may not be any tests
> for this package an
The cross-platform features have been extremely important to the
success of Java, because they have greatly expanded the number of
libraries available to developers.
On Haskell Cafe, not a week goes by that Windows (and sometimes Mac)
developers don't complain about not being able to use
Deniz Dogan wrote:
> 2009/9/30 Andrew Coppin :
>> (Mr C++ argues that homo sapiens fundamentally think in an imperative way,
>> and therefore functional programming in general will never be popular.
>
> Sounds more like Mr C++ fundamentally thinks in an imperative way
> because that's what he is u
On Wed, Sep 30, 2009 at 3:37 AM, Dimitry Golubovsky wrote:
> Hi,
>
> I am trying to use the genericserialize package
> (http://hackage.haskell.org/package/genericserialize) but cannot get
> things working.
>
> While
> buildList (sexpSerialize [1, 2, 3])
>
> yields
>
> "(1 2 3)"
>
> as it might be
Curt,
2009/9/29 Curt Sampson
> On 2009-09-29 13:18 +0200 (Tue), Alberto G. Corona wrote:
>
> > Java is part of the Java platform, that brought OS independence and
> > interoperability at the right time. .Download-execution on the client
> > was also a reason for the initial success of Java in
On Tue, 2009-09-29 at 14:31 -0400, Sean McLaughlin wrote:
> Hello,
>
>
> I have a program that does a lot of unicode manipulation. I'd like
> to use hslogger to log various operations.
> However, since hslogger uses System.IO.putX, the unicode comes out
> mangled. I hacked the source to
> use
Sorry, msb rigthmost
> Here's another approach for Bool lists with msb leftmost:
>
> bitsToInt :: [Bool] -> Integer
> bitsToInt = foldr((.(flip shiftL 1)).(+)) 0. map (fromIntegral.fromEnum)
>
>
>
> Hallo paul.brau...@loria.fr, je schreef op 30-09-09 11:18:
>
>> Hello,
>>
>> I haven't found a f
Here's another approach for Bool lists with msb leftmost:
bitsToInt :: [Bool] -> Integer
bitsToInt = foldr((.(flip shiftL 1)).(+)) 0. map (fromIntegral.fromEnum)
Hallo paul.brau...@loria.fr, je schreef op 30-09-09 11:18:
> Hello,
>
> I haven't found a function in hackage or in the standard libr
On Tue, Sep 29, 2009 at 12:54:21AM -0700, Anatoly Yakovenko wrote:
> number = do { num <- natural
> ; return $ num
> }
> main = do
>txt <- hGetContents stdin
>print $ parse number "stdin" txt
>
>
> why doesn't that work?
Could you be a little more specific? What
Hi,
I am trying to use the genericserialize package
(http://hackage.haskell.org/package/genericserialize) but cannot get
things working.
While
buildList (sexpSerialize [1, 2, 3])
yields
"(1 2 3)"
as it might be expected, I cannot deserialize it back:
*Main> (withList sexpDeserialize $ buildLi
I wrote a few variants for fun. Probably equally inefficient. I
suggest you look at Data.Binary as Andrew suggested.
-- Your original function, but with a more generic type signature.
encodeBits :: Bits n => [Bool] -> n
encodeBits bs = go 0 0 bs
where
go n r [] = r
go n r (b:b
On Wed, Sep 30, 2009 at 9:32 AM, Andrew Coppin
wrote:
> I might also point out that 90% of all desktop computers run Windows, and
> yet every single C library binding on Hackage fails to compile on Windows.
> That really needs to be fixed. (Not to mention some of the standard I/O
> functions doing
1 - 100 of 110 matches
Mail list logo