I know of a few of ways to express sharing in a pure language:
1) "Observable sharing", which, in general, is unsafe.
http://www.cs.chalmers.se/~koen/pubs/entry-asian99-lava.html
2) Using Template Haskell
http://www.dcs.gla.ac.uk/publications/PAPERS/7524/EmbedHDLinTH.ps
3) Matthew Naylor
As I pointed out a few days ago in another thread, you can benefit
from using Observable sharing [1]
Be warned that Observable sharing is a non-conservative extension of
Haskell and it breaks referential transparency.
[1] http://www.cs.chalmers.se/~koen/pubs/entry-asian99-lava.html
On Feb 8, 200
I've been programming with Haskell for a few years and love it. One
of my favorite applications of Haskell is using for domain specific
languages. However, after designing a handful of DSLs, I continue to
hit what appears to be a fundamental hurdle -- or at least I have yet
to find an adequate so
Thanks, I'm going to have to study this a bit...
Uwe
On 2/7/08, Ryan Ingram <[EMAIL PROTECTED]> wrote:
> On 2/6/08, Uwe Hollerbach <[EMAIL PROTECTED]> wrote:
> > And, coming back to my scheme interpreter, this is at least somewhat
> > irrelevant, because, since I am in a REPL of my own devising,
On 7 Feb 2008, at 12:30 PM, Chad Scherrer wrote:
On Feb 7, 2008 11:57 AM, Don Stewart <[EMAIL PROTECTED]> wrote:
Ah, yes, missing parens! Well spotted.
So a pretty printer wibble in GHC?
-- Don
Yeah, that was my first concern, but then I noticed the quantification
was different, so I'm stil
Galchin Vasili wrote:
> I am reading through the FFI doc. Any suggestions on enabling
> Haskell
> programmers to model ANSI C structs that will be passed down to C
> run-time?
If you have a C function that needs to be passed a struct, then there are
three scenarios:
(a) A common situa
On 2/7/08 3:21 PM, PR Stanley wrote:
> I will only consider events where they serve free tea and sandwiches,
> plus if there's a landing pad for the chopper nearby. :-)
BayFP's next one _might_ be at a place rhyming with "Loogle"[1], so that'd be
organic tea and I'm certain there's a landing pad..
On 8 Feb 2008, at 8:38 am, Dan Weston wrote:
I know that naming is arbitrary, but...
Digits in types seems ugly to me. In this case, it is also
redundant. Everyone but FORTRAN programmers counts from 0, not 1.
Nat and Pos seem clear. Nat0 could even mean Nat \ {0}, the
opposite of what i
On Feb 7, 2008 8:38 PM, Dan Weston <[EMAIL PROTECTED]> wrote:
> I know that naming is arbitrary, but...
>
> Digits in types seems ugly to me. In this case, it is also redundant.
> Everyone but FORTRAN programmers counts from 0, not 1. Nat and Pos seem
> clear. Nat0 could even mean Nat \ {0}, the op
Hi Bulat,
Once again, let's be careful about what "check arbitrary functions for
termination/non-trivialness" means. If you mean, "decide via an
algorithm whether a function is terminating on all inputs", then yes,
you need to restrict the class of functions. If you mean "prove in some
logic tha
I will only consider events where they serve free tea and sandwiches,
plus if there's a landing pad for the chopper nearby. :-)
At 23:11 07/02/2008, you wrote:
The community might be interested to know that there are (at least)
7 Haskell/FP user groups meeting across the world in the next two
On 2/6/08, Uwe Hollerbach <[EMAIL PROTECTED]> wrote:
> And, coming back to my scheme interpreter, this is at least somewhat
> irrelevant, because, since I am in a REPL of my own devising, I'm
> firmly in IO-monad-land, now and forever.
This is not entirely true; a REPL can be pure.
Consider the f
Hello Henning,
Thursday, February 7, 2008, 4:27:30 PM, you wrote:
>> ok, read this as "computer can ensure...", because it was exactly the
>> original question - "can computer check that any given function in
>> turing-complete language is non-trivial?"
> My original question according to
>
> h
The community might be interested to know that there are (at least)
7 Haskell/FP user groups meeting across the world in the next two
weeks!
FringeDCWashington DC/USAFebruary 9
PDXFunc Portland/USA February 11
Fun in
2008/2/7 Galchin Vasili <[EMAIL PROTECTED]>:
> Ok .. I am writing a Haskell function that will call down into the ANSI
> C library .. blah :: -> Ptr Word8 -> The underlying C function
> that "blah" is calling has a "void *" so I am using "Ptr Word 8" to model
> the "void *".
De
On Feb 7, 2008 11:57 AM, Don Stewart <[EMAIL PROTECTED]> wrote:
> Ah, yes, missing parens! Well spotted.
>
> So a pretty printer wibble in GHC?
>
> -- Don
Yeah, that was my first concern, but then I noticed the quantification
was different, so I'm still working through that one.
It was confusing,
On Feb 7, 2008 9:01 PM, Dan Weston <[EMAIL PROTECTED]> wrote:
> This may be a GHC bug, but even though in the module
> Data.TypeLevel.Num.Reps has the header
>
> {-# LANGUAGE EmptyDataDecls, TypeOperators #-}
>
> I still get an error with both ghc and ghci version 6.8.2 unless I throw
> in the -XTy
2008/2/7, Jeff φ <[EMAIL PROTECTED]>:
> I played with your foldl1MArray' last night. I noticed it can be reduced to
> . . .
>
> foldl1MArray' :: (MArray a e m, Ix i) => (e -> e -> e) -> a i e -> m e
> foldl1MArray' f a = do
> (l,u) <- getBounds a
> foldl1' (liftM2 f) (map (readArray a) (r
This may be a GHC bug, but even though in the module
Data.TypeLevel.Num.Reps has the header
{-# LANGUAGE EmptyDataDecls, TypeOperators #-}
I still get an error with both ghc and ghci version 6.8.2 unless I throw
in the -XTypeOperators flag.
> cat Go.hs
import Data.TypeLevel.Num.Reps
main = r
Dear all,
We are advertising two new Lectureships (Assistant Professorships)
in Computer Science at the University of Nottingham in England.
Applications in the area of functional programming are particularly
welcome. Further details are available from:
http://jobs.nottingham.ac.uk/vacancies.
ICFP 2007 introduced a new category of paper called an "Experience Report",
which is not required to add to the body of research knowledge, but rather
report on the effectiveness of functional tools and methods in full-scale
projects. You can read the official description in the call for papers:
h
I know that naming is arbitrary, but...
Digits in types seems ugly to me. In this case, it is also redundant.
Everyone but FORTRAN programmers counts from 0, not 1. Nat and Pos seem
clear. Nat0 could even mean Nat \ {0}, the opposite of what is proposed,
so confusion is even increased with Nat
ryani.spam:
> It looks like there is a bug with unparsing of bang-constructors in ghci:
>
> On 2/7/08, Don Stewart <[EMAIL PROTECTED]> wrote:
> >data Stream a = forall s. Unlifted s =>
> > Stream !(s -> Step a s) -- ^ a stepper
> > function
> >
It looks like there is a bug with unparsing of bang-constructors in ghci:
On 2/7/08, Don Stewart <[EMAIL PROTECTED]> wrote:
>data Stream a = forall s. Unlifted s =>
> Stream !(s -> Step a s) -- ^ a stepper function
> !s
Ok, I've done some testing on different array accessing strategies,
and at this point I believe that, as Stefan previously suggested,
using an Oleg-inspired fold for access offers the best performance.
My first non-unsafe idea was to try:
> import Data.Array.MArray
> import Data.Array.IO
> import
Hello,
Ok .. I am writing a Haskell function that will call down into the ANSI
C library .. blah :: -> Ptr Word8 -> The underlying C function
that "blah" is calling has a "void *" so I am using "Ptr Word 8" to model
the "void *". I propose to have the callers of function "blah"
chad.scherrer:
> Hello haskell-cafe,
>
> In ghci, I tried to get info for Data.Stream.Stream:
>
> $ ghci
> GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
> Loading package base ... linking ... done.
> Prelude> :m Data.Stream
> Prelude Data.Stream> :i Stream
> data Stream a where
>
Hello haskell-cafe,
In ghci, I tried to get info for Data.Stream.Stream:
$ ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Prelude> :m Data.Stream
Prelude Data.Stream> :i Stream
data Stream a where
Stream :: forall a s.
(
Adrian Hey wrote:
AFAICT neilGobbler isn't even entirely safe as an implementation of
an eager take. There's nothing the Haskell standard to stop it being
transformed into..
neilGobbler :: Int -> [x] -> [x]
neilGobbler n xs = length (take n xs) `seq` take n xs
Whoops, I see stackGobbler has th
Neil Mitchell wrote:
Hi
But the point is that *both* heapGobbler and neilGobbler are likely to
be slower and chew through at least twice as much heap as stackGobbler,
which would be the implementation of choice for both simplicity and
performance if it wasn't for this stack management problem.
Interesting. Thanks for the reply.
It might be nice to have some performance benchmarks for all these experimental
systems, so we can compare them.
I could understand that performance might be an issue for games, but for GUIs?
I mean many imperative GUI systems use rather slow message dispatchi
Hi
> But the point is that *both* heapGobbler and neilGobbler are likely to
> be slower and chew through at least twice as much heap as stackGobbler,
> which would be the implementation of choice for both simplicity and
> performance if it wasn't for this stack management problem.
Sure? That soun
On Feb 2, 2008 12:11 PM, Chaddaï Fouché <[EMAIL PROTECTED]> wrote:
> To address this I propose this function :
> foldl1MArray' :: (MArray a e m, Ix i) => (e -> e -> e) -> a i e -> m e
> foldl1MArray' f a = do
> (l,u) <- getBounds a
> firstElem <- readArray a l
> foldM (\a mb -> a `seq` mb >>= r
Neil Mitchell wrote:
Hi
I have already partially scanned the list looking for the first
element that satisfies some condition, using a tail recursive search.
If such an element is found I want to split the list at that point.
span/break? I really can't believe the memory overhead of span is
On Feb 7, 2008 4:16 PM, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote:
> Nat means "all natural numbers except zero" while Nat0 means "all natural
> numbers (including zero)". Since in computer science, natural numbers
> usually cover zero, we should use Pos instead of Nat and Nat instead of Nat0.
S
On 7 Feb 2008, at 12:07 AM, Henning Thielemann wrote:
On Wed, 6 Feb 2008, Jonathan Cast wrote:
On 6 Feb 2008, at 1:54 PM, Matthew Pocock wrote:
On Wednesday 06 February 2008, Henning Thielemann wrote:
If the type checker does not terminate because the checked
function does
not terminate o
Am Donnerstag, 7. Februar 2008 15:56 schrieben Sie:
> Don't expect anything astonishing yet, but an initial version of the
> library can be found at
>
> http:/code.haskell.org/type-level
>
> To make reviewing easier I have put the haddock-generated documentation at
>
> http://code.haskell.org/~fons
On 6 Feb 2008, at 11:32 PM, Uwe Hollerbach wrote:
All right, after a bit of dinner and some time to mess about, here's
another attempt to check my understanding: here is a simplified
version of the lisp-time example:
module Main where
import System.Time
pure_fn :: Integer -> String
pure_fn n
Don't expect anything astonishing yet, but an initial version of the
library can be found at
http:/code.haskell.org/type-level
To make reviewing easier I have put the haddock-generated documentation at
http://code.haskell.org/~fons/type-level/doc/
Some remarks:
* Only Positive and Natural nume
On Thu, 7 Feb 2008, Bulat Ziganshin wrote:
> Thursday, February 7, 2008, 4:04:03 AM, you wrote:
>
> > I.e., it's not necessary to restrict the class of functions you consider
> > if you're willing to give up on full automation. So I disagree with the
> > "only if" below.
>
> ok, read this as "co
Hello Jeff,
Thursday, February 7, 2008, 4:17:27 AM, you wrote:
> logical place for mutable arrays. However, I don't understand the
> motivation for implementing it in IO. Were mutable arrays added to
> IO because it would be difficult to write code that does both IO and
> manipulates arrays ot
Hello Dan,
Thursday, February 7, 2008, 4:04:03 AM, you wrote:
> I.e., it's not necessary to restrict the class of functions you consider
> if you're willing to give up on full automation. So I disagree with the
> "only if" below.
ok, read this as "computer can ensure...", because it was exactly
On Feb 7, 2008, at 12:27 AM, [EMAIL PROTECTED] wrote:
Are you assuming that the various users have GHC/Hugs installed? You
know about scripting through the 'runhaskell' binary, right?
I do, and I've used this. I don't want to do that here.
Let me say this again: I am making no assumptions w
Am Donnerstag, 7. Februar 2008 08:58 schrieb Leandro Demarco Vedelago:
> but when I try to load it in WinHugs I get the following error message:
>
> - Instance is more general than a dependency allows
> *** Instance : Container Abb a b
> *** For class: Container a b c
> *** Under de
Hello Peter,
an answer to an “old” e-mail (from January 25). Sorry for not answering
earlier.
Am Freitag, 25. Januar 2008 00:23 schrieben Sie:
> Wolfgang Jeltsch wrote:
> > Indeed. A functional approach to GUIs is nice but at the moment we don’t
> > have anything that is suitable for solving r
Am Donnerstag, 7. Februar 2008 02:47 schrieb Alfonso Acosta:
> > The other library I use for type-level programming is HList. It has
> > type-level booleans already so you might what to take a look at it if
> > you're not already familiar with it.
>
> Thanks I'll have a look at it.
I have to admit
Hi
> Indeed, if Catch or ESC or similar tools can handle such specifications it
> would be great. However I suspect that the translation you gave is
> different from what I wanted. I consider a function buggy, if it
> implements 'const' considerably more complicated than just saying 'const'.
> :-)
Hello Jeff,
Thursday, February 7, 2008, 1:31:59 AM, you wrote:
> I noticed that
> GHC implements mutable arrays in the IO monad. This seems odd to
> me. Arrays aren't related to IO.
IO monad isn't only about I/O but about imperative stuff in general.
there is also special monad limited to mut
Hello Henning,
Thursday, February 7, 2008, 12:29:02 AM, you wrote:
>> it's impossible to check for *arbitrary* function call whether it will be
>> terminated. seems that you don't have formal CS education? :)
>>
>> so one can develop set of functions that are guaranteed to be
>> terminated or gua
On Thu, 7 Feb 2008, Neil Mitchell wrote:
> Hi
>
> > I think what you want to say now is not just
> >
> > (filter f l) is type correct when there is some argument on which f
> > returns true
> >
> > but
> >
> > (filter f l) is type correct when there is some *element of l* on
> > which f r
On Wed, 6 Feb 2008, Jonathan Cast wrote:
> On 6 Feb 2008, at 1:54 PM, Matthew Pocock wrote:
>
> > On Wednesday 06 February 2008, Henning Thielemann wrote:
> >
> >> If the type checker does not terminate because the checked
> >> function does
> >> not terminate on the example input, then the funct
51 matches
Mail list logo