Hi Jason,
I don't know Python, but let me share some thoughts that you might
find useful.
First, a few questions about your manual translations. Are your
functions curried? For example, can I partially apply zipWith? Also,
you put a "thunk" around things like "cons(...)" --- should it not be
t
Hi Marc,
> The Chalmers Lava homepage tells abouta Xilinx version which should
> be merged in soon. But on the xilinx homepage there was no reference
> to neither Lava nor haskell..
> I'm thinking about designing a similar tool to www.combimouse.com.
you also might consider using a PIC or some su
Hi Andrew,
my probably dodgy reason for mentioning deforestation is that sharing
of intermediate values is a major stumbling block; code that uses data
linearly is possibly well suited for deforesting. See Frankau's SASL
for a language that deforests all lists simply by not letting you copy
them!
> Uniqueness typing does not lead to in-place update. If a value is
> only used once, then there is no need to update it at all!
my understanding is that if a value is uniquely-typed then it is
statically known never to have more than one reference, thus it can be
modified in-place. Some poten
Hi Dougal,
> Does anyone know of functional-style implementations of
> chess/draughts/go/anything else that might give me ideas?
there's the Mate-in-N solver in the nofib suite:
ftp://www.cs.york.ac.uk/pub/haskell/nofib.tar.gz
It takes quite a simple approach, representing the board as two li
Hi Oleg,
at the possible risk of straying from Tom's original problem, consider
the following generator that could conceivably occur in practice:
> sklansky f [] = []
> sklansky f [x] = [x]
> sklansky f xs = left' ++ [ f (last left') r | r <- right' ]
> where
> (left, right) = splitAt (leng
> tricky 0 = constant 0
> tricky d = add e0 e1
> where
> (e0, e1) = fork (tricky (d-1))
Oops, I just realised that this isn't a very good example of
expressible sharing! The problem is that it doesn't take any inputs,
and expressible sharing just collapses (partially evaluates) oper
Hello again,
since Oleg presented an approach to the sharing problem that works on
acyclic graphs, I may as well mention an alternative, pure, standard
Haskell solution which is to express the fork points in the circuit
(or expression), i.e. the points at which an expression is duplicated.
You nee
Hi Oleg,
it's not immediately clear (to me at least) how efficient your method
will be in "practice". Any method based on common sub-expression
elimination surely must inspect every node in the flattened graph. In
the worst case, an acyclic graph containing n nodes could have 2^n
nodes when flat
Hi Tom,
> So is the general strategy with observable sharing to use
> unsafePerformIO with Data.Unique to label expressions at
> construction?
something like that, yes. Basically, you just need:
{-# NOINLINE ref #-}
ref x = unsafePerformIO (newIORef x)
and you can write expressions like
:
> Emil Axelsson wrote:
> > I know of a few of ways to express sharing in a pure language:
> >
> > 1) "Observable sharing", which, in general, is unsafe.
> > 2) Using Template Haskell
> > 3) Matthew Naylor has done some work on "expressible sharing&qu
Hi,
(Warning: longish message!)
There is some concern, and rightly so, that observable sharing is
dangerous, and that your Haskell program will explode if you use it,
and perhaps even that anyone who uses it is "dirty" and should be sent
to matron's for a good scrubbing! However, when used "safe
Hi Dan,
> > import Control.Monad.State
>
> > test = do
> > put $ x+1
> > x <- return 1
> > return undefined
>
> > go = execState test undefined
I'd just like to point out that you can do something similar without
mdo. For example, you can define a monad with newVar, readVar, and
wr
Hi Claus,
> but the point is that you have a standard set of operations
> when working at that level, including conditionals, assignments,
> pointer increments, read/write, etc. you only need to define
> lifted variants of each of those operations *once*, in a library.
I think that defining lift
Hi all,
> GHC v Hugs v Yhc v NHC v ...
...Hacle & Clean!
I shoved 5 of the benchmarks that Donald used through Hacle, and
compiled the outputs using version 2.1 of the Clean compiler. Results
are below.
As for the other examples, Hacle doesn't like non-Haskell98 and
translates arb
15 matches
Mail list logo