brad clawsie wrote:
does System.POSIX.Signals bind to OS specific real-time POSIX signal
apis? (i.e., kqueue on freebsd).
No, just the usual portable signals.
http://www.haskell.org/mailman/listinfo/haskell-cafe
does System.POSIX.Signals bind to OS specific real-time POSIX signal
apis? (i.e., kqueue on freebsd).
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 28 Sep 2007, at 10:01 am, Thomas Conway wrote:
data Tree key val
= Leaf key val
| Node BST key val BST
where
type BST = Tree key val
data RelaxedTree key val
= Leaf Bal [(key,val)]
| Node Bal [(key,RelaxedTree key val)]
where
data Bal = Balanced | Unbalanced
I might be inclined to use data Bin = Zero | One
(or at least type Bin = Bool) to let the type system guarantee that
you'll only ever have binary digits in your [Bin], not any old integer.
Using [Int] is an abstraction leak, inviting people to abuse the
representation behind your back.
Rodri
--- Iain Lane <[EMAIL PROTECTED]> wrote:
> Bryan Burgers wrote:
> > On 9/26/07, Graham Hutton <[EMAIL PROTECTED]> wrote:
> >
> >> Salary will be within the range 25,134 - 32,796 pounds per year,
> >> depending on qualifications and experience. The post is available
> >> immediately, and
If you don't like explicit recursion (or points):
intToBin = map (`mod` 2) . takeWhile (>0) . iterate (`div` 2)
binToInt = foldl' (\n d -> n*2+d) 0
or even:
binToInt = foldl' ((+).(*2)) 0
On 27/09/2007, PR Stanley <[EMAIL PROTECTED]> wrote:
> Hi
> intToBin :: Int -> [Int]
> intToBin 1 = [1]
> in
Bryan Burgers wrote:
On 9/26/07, Graham Hutton <[EMAIL PROTECTED]> wrote:
Salary will be within the range 25,134 - 32,796 pounds per year,
depending on qualifications and experience. The post is available
immediately, and will be offered on a fixed-term contract for 3 years.
I don'
On 9/27/07, PR Stanley <[EMAIL PROTECTED]> wrote:
> Hi
> intToBin :: Int -> [Int]
> intToBin 1 = [1]
> intToBin n = (intToBin (n`div`2)) ++ [n `mod` 2]
>
> binToInt :: [Integer] -> Integer
> binToInt [] = 0
> binToInt (x:xs) = (x*2^(length xs)) + (binToInt xs)
> Any comments and/or criticisms on th
Thomas Conway wrote:
Although Richard's proposal was simpler, I reckon it's worth
discussing whether the where clause should allow normal
type/data/newtype declarations, effectively introducing a new scope.
There are obviously some type variable quantification and name
resolution issues that shou
prstanley:
> Hi
> intToBin :: Int -> [Int]
> intToBin 1 = [1]
> intToBin n = (intToBin (n`div`2)) ++ [n `mod` 2]
>
> binToInt :: [Integer] -> Integer
> binToInt [] = 0
> binToInt (x:xs) = (x*2^(length xs)) + (binToInt xs)
> Any comments and/or criticisms on the above definitions would be
> appre
On Thu, Sep 27, 2007 at 06:10:37PM -0400, bbrown wrote:
> If I have a set of haskell code and I create a directory with the source that
> has the following imports.
>
> (some_dir/MyLib.hs)
> module MyLib where
>
> And then I want to use that set of code at the top level directory, eg:
>
> MyTes
If I have a set of haskell code and I create a directory with the source that
has the following imports.
(some_dir/MyLib.hs)
module MyLib where
And then I want to use that set of code at the top level directory, eg:
MyTest.hs
import MyLib
How would I compile with ghc such that it loads the co
Hi
intToBin :: Int -> [Int]
intToBin 1 = [1]
intToBin n = (intToBin (n`div`2)) ++ [n `mod` 2]
binToInt :: [Integer] -> Integer
binToInt [] = 0
binToInt (x:xs) = (x*2^(length xs)) + (binToInt xs)
Any comments and/or criticisms on the above definitions would be appreciated.
Thanks , Paul
_
On 9/28/07, David Menendez <[EMAIL PROTECTED]> wrote:
> I'm not sure there is a clash.
>
> data B k v where ...
>
> is easily distinguished from
>
> data B k v = ... where ...
Indeed.
Although Richard's proposal was simpler, I reckon it's worth
discussing whether the where clause should allow nor
On 9/27/07, Albert Y. C. Lai <[EMAIL PROTECTED]> wrote:
>
> [EMAIL PROTECTED] wrote:
> > Data with where?
> > You haven't heard about GADTs?
>
> To avoid clashing with GADT's "where", I propose to rename ok's keyword
> to "wherein", or "wheretype", or something
>
> data B k v = E | F b b wherein ty
mail:
> Hi,
>
>
> Am Donnerstag, den 27.09.2007, 21:53 +0100 schrieb Magnus Therning:
> > Seems xmonad is feeling the love. The attached mail turned up on the
> > debian-user mailing list. It's high time xmonad gets packaged for
> > Debian!
>
> note that there is an Intend To Package filed:
>
Hi,
Am Donnerstag, den 27.09.2007, 21:53 +0100 schrieb Magnus Therning:
> Seems xmonad is feeling the love. The attached mail turned up on the
> debian-user mailing list. It's high time xmonad gets packaged for
> Debian!
note that there is an Intend To Package filed:
http://bugs.debian.org/cgi
Nice spot, Magnus. We at xmonad.org aim to please :)
People might be also interested in a bit of an experience report on
developing xmonad (and running an open source Haskell project) I gave at
Galois a couple of weeks ago:
http://galois.com/~dons/talks/xmonad-galois-0907.pdf
Finally, while
Tristan Allwood wrote:
Does anyone know if there is a function that tells you if a haskell
value has been forced or not? e.g. isWHNF :: a -> IO Bool
apfelmus wrote:
Note that this function [isWHNF :: a -> Bool] is not
referentially transparent
Indeed. Does it still mess up with the result
Seems xmonad is feeling the love. The attached mail turned up on the
debian-user mailing list. It's high time xmonad gets packaged for
Debian!
/M
--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnus@therning.org Jabber: magnus.therning@gmail.com
http://therni
On 2007-09-27, Duncan Coutts <[EMAIL PROTECTED]> wrote:
> In message <[EMAIL PROTECTED]> [EMAIL PROTECTED] writes:
>> On 2007-09-27, Deborah Goldsmith <[EMAIL PROTECTED]> wrote:
>> > On Sep 26, 2007, at 11:06 AM, Aaron Denney wrote:
>> >>> UTF-16 has no advantage over UTF-8 in this respect, because
I am going to be doing a lot of opengl stuff in haskell and so far one thing
has irked me. Why does haskell keep the GLFloat and GL types and not just
the Haskell types.
--
Berlin Brown
[berlin dot brown at gmail dot com]
http://botspiritcompany.com/botlist/?
[EMAIL PROTECTED] wrote:
Data with where?
You haven't heard about GADTs?
To avoid clashing with GADT's "where", I propose to rename ok's keyword
to "wherein", or "wheretype", or something
data B k v = E | F b b wherein type b = B k v
data B k v = E | F b b wheretype b = B k v
(I also propo
On 2007-09-27, Aaron Denney <[EMAIL PROTECTED]> wrote:
> On 2007-09-27, Deborah Goldsmith <[EMAIL PROTECTED]> wrote:
>> On Sep 26, 2007, at 11:06 AM, Aaron Denney wrote:
UTF-16 has no advantage over UTF-8 in this respect, because of
surrogate
pairs and combining characters.
>>>
>>>
In message <[EMAIL PROTECTED]> Tony Finch
<[EMAIL PROTECTED]> writes:
> On Thu, 27 Sep 2007, Ross Paterson wrote:
> >
> > Combining characters are not an issue here, just the surrogate pairs,
> > because we're discussing representations of sequences of Chars (Unicode
> > code points).
>
> I dislik
On Thu, 27 Sep 2007 11:41:00 -0700, Don Stewart wrote
> bbrown:
> > I am trying to print the data from a data type and also get the field
> > values. How would I reference those values if I am declaring a Show
function.
> >
> > I should probably use a class for this, but so far it is working.
>
bbrown:
> I am trying to print the data from a data type and also get the field
> values. How would I reference those values if I am declaring a Show function.
>
> I should probably use a class for this, but so far it is working.
>
> I have something along the lines of this.
>
> data SimplePla
On Thu, 27 Sep 2007, Ross Paterson wrote:
>
> Combining characters are not an issue here, just the surrogate pairs,
> because we're discussing representations of sequences of Chars (Unicode
> code points).
I dislike referring to unicode code points as "characters" because that
tends to imply a lot
On Sep 27, 2007, at 14:14 , bbrown wrote:
instance Show SimplePlayer where
show a = " posX [" ++ show a{posX} ++ "]"
instance Show SimplePlayer where
show a = " posX [" ++ show (posX a) ++ "]"
You might also want to consider deriving(Show).
--
brandon s. allbery [solaris,freebsd,p
I am trying to print the data from a data type and also get the field
values. How would I reference those values if I am declaring a Show function.
I should probably use a class for this, but so far it is working.
I have something along the lines of this.
data SimplePlayer = SimplePlayer {
On Thu, 2007-09-27 at 16:57 +0100, Tristan Allwood wrote:
> On Thu, Sep 27, 2007 at 05:31:51PM +0200, apfelmus wrote:
> > Tristan Allwood wrote:
> >> Does anyone know if there is a function that tells you if a haskell
> >> value has been forced or not? e.g. isWHNF :: a -> IO Bool let x =
> >> (map
apfelmus <[EMAIL PROTECTED]> writes:
> Tristan Allwood wrote:
>> Does anyone know if there is a function that tells you if a haskell
>> value has been forced or not?
>>
>> e.g. isWHNF :: a -> IO Bool
>>
>> let x = (map succ [0..]) in do
>> putStrLn . show (isWHNF x)-- False
>>
On Thu, Sep 27, 2007 at 05:31:51PM +0200, apfelmus wrote:
> Tristan Allwood wrote:
>> Does anyone know if there is a function that tells you if a haskell
>> value has been forced or not? e.g. isWHNF :: a -> IO Bool let x =
>> (map succ [0..]) in do putStrLn . show (isWHNF x)--
>> F
Tristan Allwood wrote:
Does anyone know if there is a function that tells you if a haskell
value has been forced or not?
e.g.
isWHNF :: a -> IO Bool
let x = (map succ [0..]) in do
putStrLn . show (isWHNF x)-- False
putStrLn . show . head $ x
putStrLn . show (isWHNF x)
Very cool. This is much nicer than when I asked much the same
question a few years back (and I can think of all sorts of
interesting things I can learn from the interface in that module).
But what about indirection chasing? Surely we want isWHNF to
return True if we have an indirection t
On Sep 27, 2007, at 9:14 AM, Pepe Iborra wrote:
Actually, in 6.8 we can build isWHNF on top of the GHC-API.
First, you need to import the ghc package:
ghci -package ghc
GHCi, version 6.7: http://www.haskell.org/ghc/ :? for help
Then, you can define the isWHNF function as follows:
Prelud
Sam Hughes wrote:
Brian Hulley wrote:
... For example, with the prefix definition of a function with
multiple clauses, the function name at the start of each clause is
already lined up since it must appear at the margin of the current
layout block ...
Or you could have everything be backwar
Actually, in 6.8 we can build isWHNF on top of the GHC-API.
First, you need to import the ghc package:
ghci -package ghc
GHCi, version 6.7: http://www.haskell.org/ghc/ :? for help
Then, you can define the isWHNF function as follows:
Prelude> :m +RtClosureInspect
Prelude RtClosureInspect> l
Tomasz Zielonka wrote:
On 9/27/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
Thomas Conway writes:
On 9/27/07, ok <[EMAIL PROTECTED]> wrote:
I have often found myself wishing for a small extension to the syntax of
Haskell 'data' declarations. It goes like this:
['where' clause to all
Hi Tristan,
I've implemented it for earlier versions of GHC, by calling some C
code which then peeps at the internal representation of a value.
From memory, I needed to pass a stable pointer to the value to the C
code, so that it can be polymorphic, without having to make it a
primitive i
Hi,
Does anyone know if there is a function that tells you if a haskell
value has been forced or not?
e.g.
isWHNF :: a -> IO Bool
let x = (map succ [0..]) in do
putStrLn . show (isWHNF x)-- False
putStrLn . show . head $ x
putStrLn . show (isWHNF x)-- True
> Well, if you never heard anyone complaining about [Char] and never had
> any problem with it's slowness, you're probably not in a field where
> the efficiency of a Unicode library is really a concern, that's for
> sure. (I know that the _main_ problem with [Char] wasn't random
> access, but you m
On 9/27/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> Thomas Conway writes:
>
> > On 9/27/07, ok <[EMAIL PROTECTED]> wrote:
> >> I have often found myself wishing for a small extension to the syntax of
> >> Haskell 'data' declarations. It goes like this:
> > ['where' clause to allow loc
2007/9/27, Duncan Coutts <[EMAIL PROTECTED]>:
> > Infrequent, but they exist, which means you can't seek x/2 bytes ahead
> > to seek x characters ahead. All such seeking must be linear for both
> > UTF-16 *and* UTF-8.
>
> And in [Char] for all these years, yet I don't hear people complaining. Most
Chaddaï Fouché wrote:
2007/9/26, Adrian Hey <[EMAIL PROTECTED]>:
Chaddaï Fouché wrote:
There can't be alternatives, unsafeIO throw by the window most
guarantee that Haskell can give you and you have to provide them
yourself (with a proof of this part of your program), but it's
inherent to the n
In message <[EMAIL PROTECTED]> [EMAIL PROTECTED] writes:
> On 2007-09-27, Deborah Goldsmith <[EMAIL PROTECTED]> wrote:
> > On Sep 26, 2007, at 11:06 AM, Aaron Denney wrote:
> >>> UTF-16 has no advantage over UTF-8 in this respect, because of
> >>> surrogate
> >>> pairs and combining characters.
>
Thomas Conway writes:
On 9/27/07, ok <[EMAIL PROTECTED]> wrote:
I have often found myself wishing for a small extension to the syntax of
Haskell 'data' declarations. It goes like this:
['where' clause to allow locally defined names in type declarations]
Nice.
Quite a few times I've
On 9/27/07, ok <[EMAIL PROTECTED]> wrote:
> I have often found myself wishing for a small extension to the syntax of
> Haskell 'data' declarations. It goes like this:
['where' clause to allow locally defined names in type declarations]
Nice.
Quite a few times I've found myself declaring type
> i am a newbie in haskell.
> i have read about the tool distcc, http://distcc.samba.org/.
> so i was wondering, does something like this already exist for
> haskell?
> would it be possible to implement a similar tool based on ghc for
> haskell or does this not make sense as a haskell program has t
On 2007-09-27, Ross Paterson <[EMAIL PROTECTED]> wrote:
> On Thu, Sep 27, 2007 at 07:26:07AM +, Aaron Denney wrote:
>> On 2007-09-27, Ross Paterson <[EMAIL PROTECTED]> wrote:
>> > Combining characters are not an issue here, just the surrogate pairs,
>> > because we're discussing representations
On 9/27/07, ok <[EMAIL PROTECTED]> wrote:
> (What the heck _is_ Tangut, anyway?)
http://en.wikipedia.org/wiki/Tangut_language
Juanma
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-caf
hi,
i am a newbie in haskell.
i have read about the tool distcc, http://distcc.samba.org/.
so i was wondering, does something like this already exist for
haskell?
would it be possible to implement a similar tool based on ghc for
haskell or does this not make sense as a haskell program has to be
co
On Thu, Sep 27, 2007 at 06:39:24AM +, Aaron Denney wrote:
> On 2007-09-27, Deborah Goldsmith <[EMAIL PROTECTED]> wrote:
> > Well, not so much. As Duncan mentioned, it's a matter of what the most
> > common case is. UTF-16 is effectively fixed-width for the majority of
> > text in the majori
On Thu, Sep 27, 2007 at 07:26:07AM +, Aaron Denney wrote:
> On 2007-09-27, Ross Paterson <[EMAIL PROTECTED]> wrote:
> > Combining characters are not an issue here, just the surrogate pairs,
> > because we're discussing representations of sequences of Chars (Unicode
> > code points).
>
> You'll
On 2007-09-27, Ross Paterson <[EMAIL PROTECTED]> wrote:
> Combining characters are not an issue here, just the surrogate pairs,
> because we're discussing representations of sequences of Chars (Unicode
> code points).
You'll never want to combine combining characters or vice-versa? Never
want to
55 matches
Mail list logo