Don Stewart [EMAIL PROTECTED] writes:
Are there binary constants in Haskell, as
we have, for instance, 0o232 for octal and
0xD29A for hexadecimal?
No, though it is an interesting idea.
Presumably it is less common since octal and hexadecimal are more
compact and almost as easy to interpret
Dan Weston wrote:
Thanks for the concise explanation. I do have one minor question though.
-+- A more useful example is
∃a. Show a = a i.e. ∃a.(a - String, a)
So, given a value (f,x) :: ∃a.(a - String, a), we can do
f x :: String
but that's pretty much all we can
Peter Hercek wrote:
I do not see why forall can be lifted to the top of function arrows.
I probably do not understand the notation at all. They all seem to be
different to me.
String - ∀a.a
a function which takes strings a returns a value of all types together
for any input string (so only
Hello,
I am trying to use the code
rels list =
let
o1 = (map makeCompEntry) $ head $ splitList list
o2 = (map makeCompEntry) $ head $ tail $ splitList list
o3 = (map makeCompEntry) $ head $ tail $ tail $ splitList list
in
case (head $ tail $ tail $ tail $
Hello Dominik,
I have used something like this and it worked very well:
import Control.Parallel.Strategies
inParallel = parMap rwhnf id
[a,b] = inParallel [f x, g y]
I hope it helps,
Alberto
On Thursday 25 October 2007 11:36, Dominik Luecke wrote:
Hello,
I am trying to use the code
Alfonso Acosta wrote:
This bit was specially helpful:
So, how to compute a value b from an existential type ∃a.(a - a)? ...
Could you give a specific example of computing existential types?
Well, the word compute was probably not a good choice, I meant the
following question: given a type
Hello,
it looks quite similar, but it is not completely what I need, I rather
need something like
inParallel = parMap rwhnf
outList = inParallel (map f) listOfLists
If I use your construction on the first 2 elements of my list, I see
several threads working, but not in the other case.
Dominik Luecke wrote:
I am trying to use the code
rels list =
let
o1 = (map makeCompEntry) $ head $ splitList list
o2 = (map makeCompEntry) $ head $ tail $ splitList list
o3 = (map makeCompEntry) $ head $ tail $ tail $ splitList list
in
case (head $
On 10/24/07, Neil Mitchell [EMAIL PROTECTED] wrote:
Hi
Are there binary constants in Haskell, as
we have, for instance, 0o232 for octal and
0xD29A for hexadecimal?
No, though it is an interesting idea.
You can get pretty close with existing Haskell though:
(bin 100010011)
brad clawsie wrote:
On Wed, Oct 24, 2007 at 06:14:49PM -0400, Xiao-Yong Jin wrote:
Is there any hope for it to be fixed before the freeze of
ports tree?
i believe that is the purpose of the extended beta/rc period, to allow
ports maintainers a chance to get things fixed before the main
Hello all,
// PLS, no flame
I think the question was not whether there's a way, how to handle the
problem of encryption of a binary number to anything suitable and, more
or less, readable by a human and transforming it to a binary form, but
whether there's such a literal or not and whether
Dusan Kolar [EMAIL PROTECTED] writes:
// PLS, no flame
I apologize if my post came across as such, that was certainly not the
intent.
I think the question was [..] whether there's such a literal or not
and whether it is bad idea to have something like 0b10111011.
I agree.
From my point
Hi,
We have no binary literals in Haskell and there are situations when it
would have been useful to have this feature (e.g., if the spec of
something that you are working with is already provided using this
notation).
While it may be useful to have overloaded binary literals in the usual
Hi folks,
I'm writing a Gnu DBM module as an exercise for learning Haskell and
its FFI. I'm wondering how I might write a function that returns the
database keys as a lazy list. I've wrapped the two relevant foreign
functions:
firstKey :: Ptr Db - IO (Maybe String)
nextKey :: Ptr Db -
Ryan Ingram wrote:
On 10/24/07, apfelmus [EMAIL PROTECTED] wrote:
So, instead of storing a list [∃a. Show a = a], you may as well
store a
list of strings [String].
I've seen this before, and to some extent I agree with it, but it
breaks down for bigger examples due to sharing.
In most
On Thu, Oct 25, 2007 at 02:40:36PM +0200, Josef Svenningsson wrote:
On 10/24/07, Neil Mitchell [EMAIL PROTECTED] wrote:
Hi
Are there binary constants in Haskell, as
we have, for instance, 0o232 for octal and
0xD29A for hexadecimal?
No, though it is an interesting idea.
From my point of view, the difference between 0b10111011 and
(bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters.
how about using ghc's new overloaded strings for this?
10111011::Binary
there used to be a way to link to ghc head's docs, but
i can't find it right now. the test is
claus.reinke:
From my point of view, the difference between 0b10111011 and
(bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters.
how about using ghc's new overloaded strings for this?
10111011::Binary
there used to be a way to link to ghc head's docs, but
i can't find it right
dons:
claus.reinke:
From my point of view, the difference between 0b10111011 and
(bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters.
how about using ghc's new overloaded strings for this?
10111011::Binary
there used to be a way to link to ghc head's docs, but
i
On Thu, 2007-10-25 at 11:30 -0400, Graham Fawcett wrote:
Hi folks,
I'm writing a Gnu DBM module as an exercise for learning Haskell and
its FFI. I'm wondering how I might write a function that returns the
database keys as a lazy list. I've wrapped the two relevant foreign
functions:
On 10/25/07, Derek Elkins [EMAIL PROTECTED] wrote:
On Thu, 2007-10-25 at 11:30 -0400, Graham Fawcett wrote:
I'm writing a Gnu DBM module as an exercise for learning Haskell and
its FFI. I'm wondering how I might write a function that returns the
database keys as a lazy list. I've wrapped
On Mon, 2007-10-22 at 10:54 -0400, Brent Yorgey wrote:
The Online Encyclopedia of Integer Sequences should really
contain more
Haskell code for describing the sequences.
Agreed! I propose an OEIS party where we all sit around one day and
submit Haskell
On Oct 25, 2007, at 13:04 , Derek Elkins wrote:
Just use unsafeInterleaveIO in the obvious definition to read all the
keys. That said, it's not called unsafeInterleaveIO for no reason.
I think it might actually be safe in this case: if the file changes
out from under your lazy I/O, far
On 10/25/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
I think it might actually be safe in this case: if the file changes
out from under your lazy I/O, far worse things happen in the gdbm
library layer than in the unsafe-IO Haskell layer.
Right, but if you do something like
do
On Oct 25, 2007, at 14:21 , Ryan Ingram wrote:
On 10/25/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
I think it might actually be safe in this case: if the file changes
out from under your lazy I/O, far worse things happen in the gdbm
library layer than in the unsafe-IO Haskell
In a sense, that's also the reason why stream fusion à la Duncan +
Roman + Don uses an existential type
data Stream a where
Stream :: ∀s. s - (s - Step a s) - Stream a
data Step a s = Done
| Yield a s
| Skip s
I thought there was a deeper reason for
On Thu, 25 Oct 2007, Don Stewart wrote:
claus.reinke:
how about using ghc's new overloaded strings for this?
10111011::Binary
there used to be a way to link to ghc head's docs, but
i can't find it right now. the test is
On 10/25/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
On Oct 25, 2007, at 14:21 , Ryan Ingram wrote:
Right, but if you do something like
do
keys - getKeysLazy db
[.. some computation A here that may or may not evaluate all the
keys ..]
addRow db newRow
[.. some
On Thu, 25 Oct 2007, Stefan O'Rear wrote:
On Thu, Oct 25, 2007 at 02:40:36PM +0200, Josef Svenningsson wrote:
On 10/24/07, Neil Mitchell [EMAIL PROTECTED] wrote:
You can get pretty close with existing Haskell though:
(bin 100010011)
where bin :: Integer - Integer, and is
On Thu, Oct 25, 2007 at 09:41:27PM +0200, Henning Thielemann wrote:
Total functions, full laziness, and compile time evaluation of finite
non-bottom CAFs...
If I write a program that approximates a big but fixed number of digits of
Pi - how can we prevent the compiler from computing Pi,
On Thu, 25 Oct 2007, Stefan O'Rear wrote:
On Thu, Oct 25, 2007 at 09:41:27PM +0200, Henning Thielemann wrote:
Total functions, full laziness, and compile time evaluation of finite
non-bottom CAFs...
If I write a program that approximates a big but fixed number of digits of
Pi - how
Carl Witty wrote:
On Mon, 2007-10-22 at 10:54 -0400, Brent Yorgey wrote:
The Online Encyclopedia of Integer Sequences should really
contain more
Haskell code for describing the sequences.
Agreed! I propose an OEIS party where we all sit around one day and
On 10/25/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
My point is that there's no promise for that one *even in C*. (The
equivalent construct being adding the new row before nextKey has
failed.)
Sure, but in C, it's highly likely that the full evaluation of the key
list happens in
Hi,
Today, if I write:
[a:[b] | a-ab , b-12]
I get:
[a1,a2,b1,b2]
Are there any guarantees that I'll never
get [a1,b1,a2,b2] instead, i.e.,
that the first list will always be the
last one to be fully transversed? Even
if I use a different compiler or a
future version of Haskell?
Reading how
On Thu, 2007-10-25 at 19:59 -0200, Maurício wrote:
Hi,
Today, if I write:
[a:[b] | a-ab , b-12]
I get:
[a1,a2,b1,b2]
Are there any guarantees that I'll never
get [a1,b1,a2,b2] instead, i.e.,
that the first list will always be the
last one to be fully transversed? Even
if I
If I understand list comprehensions correctly, what you wrote is the same
as
do a - ab;
b - 12;
[a:[b]]
which is the same as
ab == \a - do b - 12; [a:[b]]
which is the same as
ab = \a - 12 = \b - [a:[b]]
which is the same as
concat $ map ( \a - 12 = \b - [a:[b]] ) ab
On Thu, Oct 25, 2007 at 04:06:56PM +0200, Dusan Kolar wrote:
Hello all,
// PLS, no flame
I think the question was not whether there's a way, how to handle the
problem of encryption of a binary number to anything suitable and, more
or less, readable by a human and transforming it to a
On Thu, Oct 25, 2007 at 09:52:27AM -0700, Don Stewart wrote:
dons:
claus.reinke:
From my point of view, the difference between 0b10111011 and
(bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters.
how about using ghc's new overloaded strings for this?
10111011::Binary
In my best Homer Simposon voice - unfoldr - is there anything it can't do?
I have strange unfoldr love right now. I'm probably too impressed by
this function, but it takes a string and splits it into a list of
words, while keeping quoted phrases together:
import Data.List
---
Haskell Weekly News
http://sequence.complete.org/hwn/20071025
Issue 66 - October 25, 2007
---
Welcome to issue 66 of HWN, a newsletter covering
On Tue, Oct 23, 2007 at 10:01:37AM +0100, Jon Fairbairn wrote:
That sort of misses my point. Given the length of time I've
been involved with it, I hardly need encouragement to use
Haskell, but if even I find getting to the documentation
off-putting, having to know a trick to do it isn't
41 matches
Mail list logo