,
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 tests faster than Roberts. I use Robert's to
compute the table
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 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 Float
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
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 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-T2 cannot
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 about what
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 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
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 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', not
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
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
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 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
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 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
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 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
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
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 understand
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@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
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;
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
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 turns out that redirecting
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
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 groupBy ought
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 Datastructures thread
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,
Is
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
=
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
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 -
-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
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
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,
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 of the
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
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
[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])
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 (undefined::String)
Why do you want
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 functionto
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
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
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 implemented.
Not
, 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.haskell.org/mailman
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
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
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
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 me
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
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,
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
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 ::
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:
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
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
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 already, but I
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
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)]]
Prelude
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
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 generally kind of ugly; you are warned
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
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) ) +++
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
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
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
Warning: I'm not interested in a path parsing/combining library, so my
criticisms are perhaps unrelated to your goals.
One thing that I'd be interested in seeing for any Path class would be a
simple instance for FilePath (or String, if you want to imagine FilePath
will be changed). Not everyone
While true, I don't see what this has to do with the choice between
PathStart and Maybe PathRoot. The types are isomorphic; we can detect
and simplify the /.. case either way.
True
Because of the above problem, I'm willing to treat path fragments
(Relative in both lattices) as a special case.
- 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
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
After the discussion about file paths over the last several days I went
home and put together a quick trial implementation for unix file paths,
with the idea of adding windows, SMB and maybe VMS (why not?) paths. It
is based on a Path class. I'll post it later when I get home. However,
I
I would say that all paths are relative to something, whether it's the
Unix root, or the current directory, or whatever. Therefore I would call
this something like PathStart, and add:
| CurrentDirectory
| CurrentDirectoryOfWindowsDrive Char
| RootOfCurrentWindowsDrive
This
Here is my first cut at this. The unix implementation mostly works, the
windows one just has some datatypes sketched out, but it typechecks.
-- module FilePath where
import Data.Word (Word8)
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Error
import System
The following discussion occurred last September. Is there any kind of
update on any version of this book?
-
John Meacham writes:
I am looking for the book The implementation of Functional
Programming languages by S. L. Peyton Jones.
This book is
From the GHC docs:
type ReadS a = String - [(a, String)]
A parser for a type a, represented as a function that takes a String and
returns a list of possible parses (a,String) pairs.
So it returns all possible parses, hence the list. This is useful if
the encoding is ambiguous.
Henning
wrote:
On Saturday 18 December 2004 20:15, Robert Dockins wrote:
Due to one of the threads on cafe recently, I have been doing some
thinking about finalizers.
Iirc, there was a rather large discussion on finalizers on the Java memory
model list. Perhaps some useful ideas can be gathered from
Due to one of the threads on cafe recently, I have been doing some
thinking about finalizers. There is this sort of intuitive notion that
some things shouldn't be done inside finalizers. For example, no output
should be produced, because the output handles may have been finalized
already, and
On Sat, 2004-12-18 at 21:19 +0100, Marcin 'Qrczak' Kowalczyk wrote:
Robert Dockins [EMAIL PROTECTED] writes:
So, to be safe, the action of a finalizer must commute with every
other finalizer (they must be central).
What does should mean?
I am suggesting that being affine central
Well that shouldn't affect the functionality. The weak pointer was
only a way of attatching a finalizer to the Playback object. It is
true that I should probably wrap up the the SoundPlaybackRaw inside
the SoundPlayback as well, to save CPU, but it shouldn't matter for
the core
1) Finalizers are not (some say cannot) be guaranteed to run, even on
normal program termination, even if you force GC before exiting.
I only need a guarantee that it will be run if the Ptr is no longer
being referenced.
This is exactly the guarantee you _don't_ have. The only guarantee you
-- play a sample
samplePlay :: SoundSample - IO SamplePlayback
samplePlay sample = do ch - withForeignPtr sample (fsound_PlaySound (-1))
let spb = SP ch sample -- SamplePlaybackRaw
mkWeakPtr spb (Just (samplePlaybackFinalizer spb))
From the
countLines [] = 0
countLines (_:ls) = 1 + countLines ls
I would have thought that this was tail recursive and would be
flattened into iteration by the compiler. Can anyone explain why?
This function isn't tail recursive, because you do additional operations
to the result of the function
Jules Bean wrote:
On 10 Dec 2004, at 15:34, Robert Dockins wrote:
So it should get flattened, but it still doesn't run in constant
space because the x parmeter isn't strict, so it will accumulate a
bunch of closures like (((0)+1)+1)+1)+1)+1) To make it strict,
do something like
And I thought that most programmers used zipWith, which has to be
prefix.
Is this true? Can you not use backticks on a partially applied
function? If so, it seems like such a thing would be pretty useful
(although I've never actually had occasion to need it, so) I'll dig
out the report
Ketil Malde wrote:
Robert Dockins [EMAIL PROTECTED] writes:
And I thought that most programmers used zipWith, which has to be
prefix.
[1..5] `zipWith (+)` [7..]
You don't have a computer at your end of the internet? :-)
Yes, but I'm at work, and I try to limit the amount of time I spend
footprint
advantages.
OK, those are my thoughts, flame away, :)
Robert Dockins
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ketil Malde wrote:
John Goerzen [EMAIL PROTECTED] writes:
sensibly share libraries between apps. Anyway, disc is cheap.
Memory not so much, though. One advantage of having something in .so
form is that every instance of every application that uses it shares the
same in-memory image of the
On 6 Dec 2004, at 17:29, John Goerzen wrote:
That is an excellent point. Who would use an ls or cp that requires
10MB of RAM, especially on embedded devices?
This is presumably just because we don't have 'smart' linking, so the
whole library is bundled in. I imagine in principle smart linking
I imagine you would want to use a truly mutable data structure in the IO
monad -- something like an STUArray of Chars.
GoldPython wrote:
In the case of writing something like a text editor where the data
involved is by its very nature mutable, what sort of design paradigm
would you use in a
Keean Schupke wrote:
Martin Sulzmann wrote:
Well, if there's only instance which is not exported, then you can
use functional dependencies.
Assume
class C a
instance ... = C t
Internally, use
class C a | - a
instance ... = C t
The cases I was looking at had more than one instance, but thats
Should values really depend on the order of includes? Even if you limit
things to just
newChan in top level '-' you still don't know if A.a in B the same A.a
in C. Perhaps it
is enough to say A.a only exists once no matter how many times it is
directly or
indirectly imported?
This strikes me
As a purely practical matter, it seems like the easiest solution (to
this particular use case) is to write a small wrapper initializer in C
which is idempotent, then use FFI to call the wrapper, rather than
calling the initialization directly. This is easy enough to do with a
static local
My guess is because irrationals can't be represented on a discrete
computer (unless you consider a computaion, the limit of which is the
irrational number in question). A single irrational might not just be
arbitrarily long, but it may have an _infinite_ length representation!
What you have
[...] Thus (a-b) is not the same as -(b-a) for IEEE floats!
Nor is x*0 equal to 0 for every x; nor does x == y imply f(x) == f(y)
for every x, y, f; nor is addition or multiplication associative. There
aren't many identities that do hold of floating point numbers.
Yes, but they DO hold for
Actually, I've been wondering about this. If my understanding is
correct, Haskell lists are basicly singly-linked lists of cons cells (is
that correct?) A simple (I think) thing to do would be to make the
lists doubly-linked and circular. That would let us do nice things like
have O(1)
101 - 198 of 198 matches
Mail list logo