On Sunday 23 April 2006 02:19 pm, you wrote:
[snip some discussion]
> Perhaps something like:
>
> class MonadIO m => MonadIOE m where
> catch :: m a-> (Exception -> m a) -> m a
> throw
> catchDyn
> throwDyn
> -- etc
>
> instance MonadIOE m => StateT s m where ...
> instan
On Apr 21, 2006, at 1:27 PM, Brian Hulley wrote:
Robert Dockins wrote:
On Apr 21, 2006, at 10:34 AM, Brian Hulley wrote:
Robert Dockins wrote:
On Apr 21, 2006, at 9:56 AM, Brian Hulley wrote:
Hi -
I've run into the global mutable state problem described in
http://
[snip]
There is
On Apr 21, 2006, at 10:34 AM, Brian Hulley wrote:
Robert Dockins wrote:
On Apr 21, 2006, at 9:56 AM, Brian Hulley wrote:
Hi -
I've run into the global mutable state problem described in http://
www.haskell.org/hawiki/GlobalMutableState
Since the page was last edited in March last year
On Apr 21, 2006, at 9:56 AM, Brian Hulley wrote:
Hi -
I've run into the global mutable state problem described in http://
www.haskell.org/hawiki/GlobalMutableState
Since the page was last edited in March last year, I'm wondering if
there have been any developments or further thoughts on how
On Apr 19, 2006, at 3:06 PM, Brian Hulley wrote:
Thanks. I might try this if I don't have any luck with finger trees
(from Udo's post), or if they seem too heavy for the simple thing
I'm planning to use them for (implementing the text buffer for an
edit control which needs a mutable array
On Apr 12, 2006, at 4:09 PM, Scott Weeks wrote:
Or carry an instance in along with a type parameter, using
existentials or GADT.
Brandon Moore
Do you know of an example that would apply to my situation?
I think I neglected to state part of my problem. I am storing the
root nodes of bt
On Apr 12, 2006, at 3:18 PM, Scott Weeks wrote:
Well, if you get an "ambiguous type variable" error, you probably (I
think) need to add some type annotations. For example:
class Foo a where
foo :: a
bar :: a -> String
Evaluating bar foo will result in an error, but bar (foo :: Integer
On Apr 11, 2006, at 10:09 AM, David F. Place wrote:
Hi All,
Since it seems that real applications need more than just union,
intersection, difference and complement to be fast to make EnumSet
useful, I've been looking into the less naive approaches to the
other things. In particular,
ng that those lovely, inscrutable algorithms don't help,
though ;-)
Rob Dockins
Cheers,
Daniel
Am Sonntag, 9. April 2006 00:54 schrieb Robert Dockins:
On Apr 8, 2006, at 1:58 PM, David F. Place wrote:
Thanks Bulat and Robert. I implemented Bulat's idea as the
following. It test
On Apr 8, 2006, at 1:58 PM, David F. Place wrote:
Thanks Bulat and Robert. I implemented Bulat's idea as the
following. It tests faster than Roberts. I use Robert's to
compute the table. The performance seems satisfactory now.
size :: Set a -> Int
size (Set w) = countBits w
where
On Apr 8, 2006, at 4:24 AM, Bulat Ziganshin wrote:
Hello Daniel,
Saturday, April 8, 2006, 4:21:14 AM, you wrote:
Unless I overlooked something, I use foldBits only via size
(though that's
used a lot).
size of set? there is much faster method - use a table
[0..255] -> number of bits in t
On Apr 7, 2006, at 9:43 AM, Jacques Carette wrote:
Robert Dockins wrote:
The behaviour of NaN actually makes perfect sense when you
realise that
it is Not a Number. Things that are not numbers are incomparable
with
things that are.
Yes, NaN can be of type Float. But it's not a
On Apr 7, 2006, at 1:36 AM, [EMAIL PROTECTED] wrote:
G'day all.
Quoting Robert Dockins <[EMAIL PROTECTED]>:
Eww! Be careful how far you depend on properties of
typeclasses, and make
sure you document it when you do.
The behaviour of NaN actually makes perfect sense when
On Thursday 06 April 2006 06:44 pm, John Meacham wrote:
> On Thu, Apr 06, 2006 at 10:52:52PM +0100, Brian Hulley wrote:
[snip a question about Eq and Ord classes]
> well, there are a few reasons you would want to use inheritance in
> haskell, some good, some bad.
>
> 1. one really does logically
On Apr 6, 2006, at 11:25 AM, Michael Goodrich wrote:
Thanks so much for your help. I should have made clear that I was
aware that the definitions were mutually dependent. What I was
hoping was that Haskell could solve this for me without my having
to resort to effectively finessing any se
On Wednesday 05 April 2006 04:51 pm, Michael Goodrich wrote:
> Oops, I just realized that you gave me the answer, namely that it won't
> find fixed points of numeric sets of equations.
>
> Pity, that would really have made Haskell useful for this kind of
> scientific computing.
See section 4 of:
On Apr 5, 2006, at 12:42 PM, Josef Svenningsson wrote:
Sorry to barge in in the middle of your discussion here..
Hey, if we wanted a private conversation, we'd take it off-list. :-)
On 4/5/06, Robert Dockins <[EMAIL PROTECTED]> wrote:
There is a fair bit of disagreement
On Apr 5, 2006, at 10:49 AM, Brian Hulley wrote:
Robert Dockins wrote:
On Apr 1, 2006, at 3:23 PM, Brian Hulley wrote:
[snip]
" For particular types T1 and T2, if (f (x::T1))::T2 === g x for
all x in T1 then f :: T1->T2 and g ::T1->T2 can be freely
substituted since the context T1
On Apr 1, 2006, at 3:23 PM, Brian Hulley wrote:
Robert Dockins wrote:
[snip]
From an earlier post:
Now since f and g compute the same results for the same inputs,
anywhere in a program that you can use f you could just replace f
by g and the observable behaviour of the program would be
[snip]
> No, it doesn't, because that wasn't my argument. Consider:
>
> f :: C a => a->a
> g :: C a => a->a
>
> Now if we can define just one instance of C, eg T1 where f (x::T1) \= g
> (x::T1), then we can tell f and g apart for all instances of C, even when
> there is another instance of C, eg T
On Saturday 01 April 2006 11:53 am, Brian Hulley wrote:
> Claus Reinke wrote:
> > the usual way to achieve this uses the overloading of Nums in Haskell:
> > when you write '1' or '1+2', the meaning of those expressions depends
> > on their types. in particular, the example above uses 'T Double', no
On Saturday 01 April 2006 07:50 am, Brian Hulley wrote:
> Greg Buchholz wrote:
> >Hmm. It must be a little more complicated than that, right? Since
> > after all you can print out *some* functions. That's what section 5
> > of _Fun with Phantom Types_ is about. Here's a slightly different
>
On Mar 22, 2006, at 2:16 PM, David F. Place wrote:
Hi All,
I really appreciate all the help I received when I asked you to
critique my PrefixMap module a few weeks ago. I think I am making
good progress in correcting the "lisp" in my Haskell programming.
I'll be very grateful to anyone
On Mar 20, 2006, at 5:15 PM, Neil Rutland wrote:
Hi there,
thank you all for your help with regards to the integer addition
question that i asked yesterday it was very good in clarifying my
ideas. However i would now like to ask for your expert help once
again.
Basically i have a list o
On Mar 8, 2006, at 2:27 PM, zell_ffhut wrote:
Could you explain what the function does.. I can't seem to peice it
together.
It takes three things 1) a function 2) an index and 3) a list. It
finds the nth element of the list, applies the function to it and
then returns a new list containi
On Mar 8, 2006, at 1:29 PM, zell_ffhut wrote:
Im afraid im baffled again!
Im now trying to add a char to a string of strings (eg - ["434233434"
"444929192" "909313434"]
Im sure i can use my previous function to help me achive this, but
i can't
seem to get it workinging
charToGrid :: Char
On Mar 8, 2006, at 12:08 PM, [EMAIL PROTECTED] wrote:Today, I reviewed a function I wrote a few months ago. The function, dropTrailNulls, takes a list of lists and drops trailing null lists. For instance: *Main> dropTrailNulls [[1],[2,3],[],[]] [[1],[2,3]] My original implementation was terribl
On Mar 6, 2006, at 1:05 PM, Harry Chesley wrote:
This is more of an algorithm question than a language question, but
any insights would be much appreciated.
The problem is to input a series of programs and find previous
occurrences of the same algorithm.
The programs consist of a set of
On Feb 27, 2006, at 2:30 PM, David F.Place wrote:
Hi,
I'm a newish Haskell hacker with way too much experience hacking
Lisp.At first, I found my Haskell code looking very lisp-y. I
think my code is becoming more idiomatic haskell. I would be very
grateful to anyone who would take
On Feb 20, 2006, at 2:26 PM, Henning Thielemann wrote:
On Mon, 20 Feb 2006, Robert Dockins wrote:
I personally disagree with your preference for custom datatypes
with a value representing failure to lifting types with Maybe.
I understood that part of the guidelines as a pleading for Maybe
On Feb 20, 2006, at 12:48 PM, Christian Maeder wrote:
Hi,
haskell admits many programming styles and I find it important that
several developers of a prject agree on a certain style to ease
code review.
I've set up guidelines (still as plain text) for our (hets) project in
http://www.inf
On Feb 13, 2006, at 2:26 PM, [EMAIL PROTECTED] wrote:Hi, I've posted a couple messages to the Haskell Cafe in the last few months. I'm new to Haskell. But, I've set out to implement my own vectors, matrices, complex numbers, etc. One goal I have, is to overload operators to work with my new typ
For the record, a little more digging turned up this
http://portal.acm.org/citation.cfm?id=583852.581496
which answers most of my questions.
On Feb 10, 2006, at 2:02 PM, Robert Dockins wrote:
OK. I've been doing a little thinking about type lambda in Haskell.
Now, I understan
OK. I've been doing a little thinking about type lambda in Haskell.
Now, I understand the prevailing wisdom is that adding type lambda
and/or partially applied type synonyms to the haskell type system
would make type checking/inference undecidable. The reason given is
that higher-order un
On Feb 10, 2006, at 11:09 AM, Colin Paul Adams wrote:
Is there any Haskell code around that can interpret combinatory
logic expressions?
Humm. That's kind of a broad question. I've written a shell for
interpreting the pure untyped lambda calculus which has definitions
for Turner's Combin
[Moved to cafe; time to stop bothering the Haskell' committee...]
On Feb 8, 2006, at 1:19 PM, Malcolm Wallace wrote:
Robert Dockins <[EMAIL PROTECTED]> writes:
instance (Bin a,Bin b,Bin c,Bin d) => Bin (a,b,c,d)
See the problem? Sooner or later (probably sooner) I'll
ems
pretty ugly, and I think they'd be pretty hard to bolt onto an HM base.
Robert Dockins
Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
-- TMBG
___
Haskell-Cafe mailing list
Haskell-Cafe@ha
On Feb 3, 2006, at 11:28 AM, Maurício wrote:
Kurt Hutchinson wrote:
On 2/2/06, Maurício <[EMAIL PROTECTED]> wrote:
I understand those examples, but I really would like to know
how to
do that with monads. I would like to ask the same question, but
now with
this code:
double a = 1000;
dou
I think you're looking for IORef http://www.haskell.org/ghc/docs/
latest/html/libraries/base/Data-IORef.html
Something like this (untested) should do what you want:
example :: IO ()
example = do { ref <- newIORef 1000; loop ref }
where loop ref = do
x <- readIORef ref
print x
Does anyone know of a good library or libraries which will allow me
to perform arithmetic operations on
1) binary integers (signed and unsigned) of various fixed sizes?
2) IEEE 754 floating point numbers (single and double precision).
Pure Haskell is preferable, but I'll make do with C bin
perfectly matching Robert Dockins'
'threadlocal' proposal?
Yes, actually. This is precisely the use case that got me thinking
about threadlocal storage in the first place. I'm working on Shellac
(http://www.mail-archive.com/haskell@haskell.org/msg17871.html) and
it
"unique" state for each OS separate.
> Maybe you should put all this
> on the wiki page. I'd like to see how/if you could implement
> the hypothetical device driver API I put there, or even just
> use the "oneShot" function or similar at the top level.
Fellow haskellers,
I have a proposal I would like to enter into the eternal top-level IO
debate. The proposal
involves a minor language extension and some runtime support for
thread local reference cells.
I believe it has the potential to meet many of the needs of those
requesting top leve
On Jan 13, 2006, at 4:35 PM, Jon Fairbairn wrote:
On 2006-01-13 at 13:32PST Jared Updike wrote:
That works except it loses single newline characters.
let s = "1234\n5678\n\nabcdefghijklmnopq\n\n,,.,.,."
Prelude> blocks s
["12345678","abcdefghijklmnopq",",,.,.,."]
Also the argument to groupB
On Monday 09 January 2006 04:09 am, Tim Walkenhorst wrote:
> Thanks for all infos.
>
> I'll apply that Ref-datatype from the "observable sharing" paper
> to my problem and see where this brings me. I'm also looking
> into the solution Paul Hudak presented in the
> "Detecting Cycles in Datastructure
On Sunday 08 January 2006 06:43 am, Tim Walkenhorst wrote:
> {- Disclaimer: I'm rather new to Haskell and completely new to this board.
> I may not use the correct terminology in all cases, but I hope my
> intention becomes clear when you have a look at the code-snippets. -}
>
> Hey ho,
>
On Dec 29, 2005, at 11:26 AM, David F. Place wrote:
Hi,
I am trying to read _Arrows, Robots, and Functional Reactive
Programming_ by Hudak, et al.
http://www.haskell.org/yampa/AFPLectureNotes.pdf
In section 2.1 there are a number of equations of the form:
g’ :: SF A C
g’ = arr g
= ar
On Dec 28, 2005, at 1:38 PM, Tomasz Zielonka wrote:
On Wed, Dec 28, 2005 at 05:28:28PM +, Chris Kuklewicz wrote:
But STM, wrapped in small pieces, makes for interesting IO commands
(untested):
waitForZero :: (Num a, Ord a) => (TVar a) -> IO ()
waitForZero tv = atomically $ do
v <- rea
On Dec 28, 2005, at 11:14 AM, Chris Kuklewicz wrote:
John Goerzen wrote:
Hello,
I have the need for a locking object that can provide shared and
exclusive locks in much the same manner as the POSIX flock()
function.
A thread that acquires an exclusive lock has a guarantee that no
other
-divides a b = (mod a b == 0)
+divides a b = (mod b a == 0)
On Dec 20, 2005, at 11:09 AM, Daniel Carrera wrote:
John Peterson wrote:
Add a type signature:
prime :: Integer -> Bool
It's defaulting to Int and you're getting overflows
Thanks. Hmm... it's still not working.
Btw, I mis-reporte
BTW, there has already been some work in this area.
http://www-i2.informatik.rwth-aachen.de/~stolz/dhs/
http://www.informatik.uni-kiel.de/~fhu/PUBLICATIONS/1999/ifl.html
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mai
On Sunday 11 December 2005 06:54 pm, Joel Reymont wrote:
> Thank you Andrew! Does it have any effect on performance? Is there a
> speed up of any sort from not passing parameters?
Shooting from the hip here, but I doubt it -- AFAIK it all gets lambda-lifted
in the compiler anyway.
> On Dec 11, 2
On Tuesday 06 December 2005 04:00 pm, [EMAIL PROTECTED] wrote:
> From: "Shae Matijs Erisson - [EMAIL PROTECTED]"
> Sent: Tuesday, December 06, 2005 6:16 PM
>
> > [EMAIL PROTECTED] writes:
> > > being occupied with learning both languages, I'm getting curious if
> > > Haskell couldn't achieve most o
On Oct 27, 2005, at 11:54 AM, Creighton Hogg wrote:
Hi,
so I'm a newbie getting used to Haskell. I'm writing some
simple things like genetic algorithms in it for practice,
and I keep coming across something that really bugs me:
are there any standard libraries that allow you to
do imperative s
On Oct 27, 2005, at 11:01 AM, Joel Reymont wrote:Folks,With lots of help from #haskell and haskell-cafe I came up with the following setup. It's working fine but requires quite a bit of boilerplate code. Could you please help me simplify it?I apologize for the very long message and will describe an
[snip]
Now comes the tricky part for me. Since the control can have three different
types of children I use a helper that parses the body of the control using other
parsers, collecting their results in three lists:
ctrlBodyParser :: CharParser ([Value], [Property], [Control])
use Data.Typeable ?
Thank you very much.
On 10/13/05, *robert dockins* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
In GHC you can do this:
> import Data.Typeable
> isString :: (Typeable a) => a -> Bool
> isString x = typeOf x == typeOf (un
In GHC you can do this:
> import Data.Typeable
> isString :: (Typeable a) => a -> Bool
> isString x = typeOf x == typeOf (undefined::String)
Why do you want this? It's not the kind of operation one does very
often in Haskell.
Huong Nguyen wrote:
Hi all,
I want to write a small function
For the version with type signatures, you are trying to divide integers
using the (/) function. This function expects values in the class
Fractional, and Integer isn't a member. Replace with div, which does
integer division.
pnorep days n = (numeratorex days n) `div` (denominatorex days n)
It sounds like you are porting an algorithm which does destructive
updates on this tree. If so, you can use the ST (or IO) monad and use
STRef (IORef).
data Tree a
= TreeRoot { stuff:: STRef a
, children :: STRef [Tree]
}
.
you would get at the data li
Mark Carter wrote:
I'm puzzling out how to get a Bool from am IO Bool. I know I'm not
supposed to, but I don't see any way around my predicament.
The basic setup is: I have an edit box, and a panel. If you click the
LMB on the panel when the edit box is checked, this means you want to
move a
On Sunday 18 September 2005 07:59 am, Tom Hawkins wrote:
> Aaron Denney wrote:
> > On 2005-09-17, Jason Dagit <[EMAIL PROTECTED]> wrote:
> >>A link to supertyping can be found here:
> >>http://repetae.net/john/recent/out/supertyping.html
> >>
> >>After reading that, I wonder why it's not implemente
ckends (optimization, code gen, linking) which
interface via something that looks a lot like external core, as well as
making Haskell more amenable to formal verification.
Robert Dockins
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www
Some people may suggest that you to create top-level IORefs using
unsafePerformIO, but I don't recommend that for this situation.
Well I can't imagine which particular people you have in mind :-)
But, as a vocal advocate of sound support for top level mutable
state, I would just like to go on
I'm doing a 3D simulation. Now I need something like variables in
imperative languages. My mainLoop check for new events and renders
scene.
Then you want IORef.
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.IORef.html
Consider, however, that this kind of construct can be do
yin wrote:
Hello all!
I'm doing a 3D simulation. Now I need something like variables in
imperative languages. My mainLoop check for new events and renders
scene. To use input for controling camera position I need variables. An
equivalent code in C:
void main_loop() {
int loop_num = 0;
I'm doing a 3D simulation. Now I need something like variables in
imperative languages. My mainLoop check for new events and renders
scene.
Then you want IORef.
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.IORef.html
I saw it. The problem is, I need an amount of 100*X of mu
Uhm... and what if I write some runtines in plain C, then bind them to
Haskell and and use then as in OOP:
[snip]
Is this apoarch safe enougth, what do you think?
If you do it carefully. But why? It sounds like you are planning to
write a transliteration of the code you would write in
Thanks for your reply,
i just simply removed the first line and it works, but i dont understand
why 1/x is not Float.
It depends on the type of 'x'. If 'x' is a Float, (1/x) will be a
Float. If 'x' is a Double, (1/x) will be a Double. If 'x' is an
Integer (1/x) will not typecheck becaus
You are trying to divide by an Integer and get a Float. Haskell doesn't
do automatic numeric conversion, so you have to do the casts manually.
Prelude> let sumHam n = sum [ 1 / (fromIntegral x) | x <- [1..n] ]
Prelude> sumHam 5
2.283
Dinh Tien Tuan Anh wrote:
could anyone tell
you are completely skipped the point that these is just for C++
programmers wanting to program in Haskell and aimed to give them
faster learning path and easy to use instruments
Not to forget to make learning easier for programmers of Perl, Ruby,
Python, Rexx, Tcl, APL, C#, Java, Bash, Fortran,
Arjun Guha wrote:
I have an extremely large source file of about 11 MB. It's the all-pairs
shortest paths data for a map of the Hyde Park area of Chicago (no real
reason, really). I generated information in Scheme and printed the result to
a Haskell source file as a list. I then edited the
but GHC complains:
Illegal instance declaration for `Foo (Either b b)'
(The instance type must be of form (T a b c)
where T is not a synonym, and a,b,c are distinct type variables)
In the instance declaration for `Foo (Either b b)'
unless I'm totally mistaken, your proble
Here is an idea I slammed out. Maybe it will help you.
The basic idea is to create two types -- one which supports annotations
and one which ignores them. Only write your calculations once, with
annotations. Uses typeclasses to ignore the annotations when you don't
want them.
Rene de Viss
> So, in a word: I need a tutorial for dummies
I don't know of any tutorials like you have described. Perhaps someone
else does?
Now, my current problem is: my program for solving quadratic equation
won't compile...
You left out some 'Just' constructors.
import System
solve_qe :: May
I'm writing a small unit library to excercise my barely existing
Haskell skills.
However I can't figure out how to make Haskell accept any type
of a specific class.
[snip]
What you want is a technique called "existential types". The wiki page
is here: http://haskell.org/hawiki/ExistentialT
Frank-Andre Riess wrote:
>>L.S.,
>>
>>I have written a reference manual for the most common Haskell monad
>>functions, in the
>>style of "A Tour of the Haskell Prelude". It can be found at:
>>http://members.chello.nl/hjgtuyl/tourdemonad.html
>>
>>
>>Known bug:
>>Not all keywords in the "See a
there are other more esoteric things, but this is about as
complex as I try to go to avoid severe headaches :)
Robert Dockins
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
oComplex' is a class which relates two types 'a' and 'b'
AND the type 'a' uniquely determines the type 'b'.
Hope that helps,
Robert Dockins
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
> One of the best bad example is the use of boolean as arguments.
Oh, yes. That's a pet peeve of mine. About 99% of boolean arguments
should be meaningful two-valued enumerated types. It's literally a
one-liner to create such an enumerated type, so there's no excuse.
The documentation eff
If you want C compatibility, you need
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Array.Storable.html
which is similar. You then use the "withStorableArray" to call out to
your C functions.
Florian Weimer wrote:
* robert dockins:
Probably you have seen this alre
Probably you have seen this already, but I thought I'd mention it on the
off-chance you missed it:
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Bits.html
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Word.html
Probably you'll want to think about an IOUArray of
'a' 0 :: Bool -> ()
Mostly, one should just try to write functions so that they take their
parameters in the most convenient order for partial application.
Robert Dockins
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
That leaves one aspect of Haskell vs Ocaml I don't yet understand.
What are the advantages of lazy evaluation?
I'd recommend this paper (once again):
http://www.md.chalmers.se/~rjmh/Papers/whyfp.html
One of the main points of the paper is that lazy evaluation enables a
new way of modularizing cod
> Hi all!
> I'm trying to join to lists of lists. The problem is, i would like to
> get a new list of lists of tuples and not list of tuples of lists (that
> what zip makes).
>
> list1 = [[1,2],[3,4],[5,6]]
> list2 = [[a,b],[c,d],[e,f]]
>
> desiredlist = [[(1,a),(2,b)],[(3,c),(4,d)],[(5,e),(6,f)]]
Hi all,
Again, I'm the new guy slowly learning this "fuctional programming"
thing. :-)
[snip]
So, I'm tempted to conclude that FP is only applicable to situations
where user interaction is a small part of the program. For example, for
simulations.
Now, I'm sure I'm not the first person to have
Well, yes, but I'd argue that ordinary (transfinite) mathematical
induction will work just fine here. It's just that the set we're doing
mathematical induction over is one larger (in the ordinal sense) than
usual. Let S = N union {w}, where N is the usual set of naturals and w
is an additional new
Well, I also omited the word "countable". I figure it's understood
since computers only deal with finite data. And given an infinite
list, any finite "head" of it would meet the criteria, so the
distinction is moot. Unless Haskell has some neat property I am not
aware of :-)
Due to lazyness, we can
See:
http://haskell.org/hawiki/FunDeps
> class CRank a b where
> rank :: a -> b -> Maybe Integer -- Nothing means b is out of range
or badly constructed
> unrank :: a -> Integer -> Maybe b -- Nothing means rank is out of
range
> count :: a -> Maybe Integer -- Nothing means infinity
[sn
Now I have one problem (Well 2 really but the second one is just me not
having programmed in haskell for so long that I forgot). getLine is used for
the sole purpous of stopping the program and allowing the user to read the
error message before the window closes but error does not allow me to do
t
No, that should work. Haskell equality is not at all like Java
equality. In java, '=' basicaly means pointer equality. I am not aware
of a way to even make that comparison in Haskell (in general). Haskell
'=' behaves a lot more like equals() in Java.
Of course, you mean Haskell '==', as Haskel
Hi,
I'm beginning to study Haskell, For the following
a = [1,2,3]
b = "there"
do x <- a
y <- b
return (x , y)
Winhugs cannot run it. Gives
Syntax error in input (unexpected backslash (
lambda))
Your problem is that you're using monads to grab the contents of a and
b, while a and b are
2) It is performant (mostly). At least it outperforms other Haskell IO
methods I have tried. My 'wc' is about twice as fast as the current
shootout version in informal tests (the shootout code is included in the
repo). My md5 can sum somewhere between 2-4Mb/Sec on my hardware.
You know that
tations
(the original purpose after all) and see how that goes. I'd also like
to try gzip and gunzip transformer layers.
Any ideas for improvements (including patches!) are welcome.
Robert Dockins
PS the code currently includes a number of vestigial remnants of false
starts, and is gen
expr :: Parser Int
expr = do t <- term
do symbol "+"
e <- expr
return e
return (t + e)
+++ return t<-
't' is not in scope at the arrow. t only exists inside the
do block, and your code parses like this
( do t <- return (t+e) )
Well, there is a sort-of canonic version for every path; on
most Unix systems the function realpath(3) will find it.
Here is the BUGS listing from 'man realpath' on my system:
Never use this function. It is broken by design since it is impossible
to determine a suitable size for the output buffe
I have been ruminating on the various responses my attempted file path
implementation has generated. I have a design beginning to form in the
back of my head which attempts to address the file path problem as I lay
out below. Before I develop it any further, are there any important
considerati
I don't pretend to fully understand various unicode standard but it
seems to me that these problems are deeper than file path library. The
equation (decode . encode)
/= id seems confusing for me. Can you give me an example when this
happen?
I am pretty sure that ISO 2022 encoded strings can have m
Even simple manipulations break in the presence of encoding issues, or
even just of unusual paths. What is the extension of "\\.\TAPE0" ? Its
not "\TAPE0". BTW this is a valid path on Windows 2000 upwards. If you
don't care about corner cases, then you have no worries. It would be
nice to
- Keep the existing System.IO API the same. openFile, createDirectory
... will take the file path as string.
The problem is that "string" means different things in haskell and in C.
A C "string" is really just a contiguous sequence of octets in memory.
A haskell string has a particular interpreta
101 - 200 of 234 matches
Mail list logo