newb | 3 Apr 00:55 2006
Picon

Re: PPM image manipulation


its ok got it all sorted now :)
--
View this message in context: http://www.nabble.com/PPM-image-manipulation-t1382306.html#a3717745
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.
Dmitri O.Kondratiev | 3 Apr 10:39 2006
Picon

Re: Haskell on Pocket PC?

Hi Neil,
Thanks for your reply.
Starting from YHC porting pages the only  source for Win32 port I
found is  WinHaskell.
[http://www-users.cs.york.ac.uk/~ndm/projects/winhaskell.php]
I have not yet found which port it is: Hugs, YHc, ...?

Also there is a thing called WinHugs at
http://www-users.cs.york.ac.uk/~ndm/projects/winhugs.php
but I could not find source download for this one.

Speaking about YHC:
1) So far I found only a development source for GCC which for the
complete build needs not only GMP,  but GHC as well. The last one is
needed, correct me if I am wrong, for building YHC, but not for YHi.
Correct?

Is porting Hugs harder then YHC? What do you think?
I have successfuly compiled and run Hugs on NetBSD. Hugs compilation
does not require GHC. So may be (at least for intepreter) Hugs is
easier to port then YHC/YHi?

cheers,
Dima

On 3/31/06, Neil Mitchell <ndmitchell <at> gmail.com> wrote:
> Hi,
>
> If I was doing a Haskell port to PPC Windows Mobile, I'd start with
> Yhc. If you port a small, portably written runtime (Yhi) in C, then
(Continue reading)

Nils Anders Danielsson | 3 Apr 11:53 2006
Picon
Picon

Re: Distributing monadic(?) functions across dyadic functions

On Sun, 02 Apr 2006, "Jared Updike" <jupdike <at> gmail.com> wrote:

> Something like "distribute fst (==)" where
>
>> distribute f op x y = f x `op` f y

A function like this has been suggested for the standard libraries a
couple of times before. Someone suggested the name "on", which I quite
like:

  (*) `on` f = \x y -> f x * f y

>> unionBy (distribute fst (==)) listOfPairs1 listOfPairs2

unionBy ((==) `on` fst) xs ys

I think on makes the code rather readable: union by equality on first.

--

-- 
/NAD
Fritz Ruehr | 3 Apr 12:41 2006

Re: "show" for functional types

I've revised my thinking about printing (total, finite) functions: I 
should have respected the notion that a printed representation can be 
cut-and-pasted back in at the prompt for evaluation to something equal 
to the original. I've also revised my implementation to this effect, so 
that functions (over suitable classes of types) are now instances of 
the classes Bounded, Enum, Eq, Ord and Show, with the desired printing, 
as demonstrated by this session transcript:

> > not == not
> True
> > not == id
> False
> > id == (not . not)
> True
> > fromEnum not
> 1
> > not == toEnum 1
> True
> > not
> (\x -> case x of False -> True; True -> False)
> > not == (\x -> case x of False -> True; True -> False)
> True
> > id :: Bool -> Bool
> (\x -> case x of False -> False; True -> True)
> > const True :: Bool -> Bool
> (\x -> case x of False -> True; True -> True)
> > (&&) == (&&)
> True
> > (&&) == (||)
> False
(Continue reading)

Pete Chown | 3 Apr 13:43 2006

Re: Breaking up long lines

Neil Mitchell wrote:

> The indentation rules are quite complex, but just type your code
> "sensibly indented" and it will probably just work.

My biggest problem in this area was following haskell-mode's defaults
too strictly.  I found that things ended up indented more than was
necessary for clear layout, so wasting a lot of the space I had
available.

Pete
Neil Mitchell | 3 Apr 14:15 2006
Picon

Re: Haskell on Pocket PC?

Hi,

> Starting from YHC porting pages the only  source for Win32 port I
> found is  WinHaskell.
> [http://www-users.cs.york.ac.uk/~ndm/projects/winhaskell.php]
That's an entirely separate project, it just uses Yhc/GHC/Hugs.

Thats the things about the Yhc port to Windows - its not a port, Yhc
just natively supports Windows.

Get the standard source:
darcs get http://www.cs.york.ac.uk/fp/darcs/yhc-devel

src/runtime/BCKernel/msvc and you'll find MSVC (Microsoft Visual C)
projects for 2003 and 2005. From the root of the darcs tree, if you
have either MSVC installed, "makefile yhi" and it will get built.

See [http://www.haskell.org/haskellwiki/Yhc/Building] for details of
how to build on Windows.

> Also there is a thing called WinHugs at
> http://www-users.cs.york.ac.uk/~ndm/projects/winhugs.php
> but I could not find source download for this one.
Thats part of Hugs, just check out Hugs from CVS and You'll have that.
Entirely unrelated to Yhc.

> 1) So far I found only a development source for GCC which for the
> complete build needs not only GMP,  but GHC as well. The last one is
> needed, correct me if I am wrong, for building YHC, but not for YHi.
> Correct?
(Continue reading)

David F. Place | 3 Apr 14:19 2006

Efficient Sets for Small Enumerations

Often when writing algorithms which involve set operations on small  
enumerations, I start off using Data.Set.  I soon find performance  
requires rewriting that code to use bitwise operations.  I miss the  
nice interface of Data.Set and the type checking of using a proper  
data type.

So, as an exercise in writing a library, I wrote out an  
implementation of bitwise set operations using the interface of  
Data.Set with a couple of extensions.  It provides an abstract  
interface and type checking.  Using GHC -O3, code compiles right down  
to the primitive bit-twiddling operators.  My example program (a  
sudoku solver) runs several times faster.

I'll be grateful for any feedback on this.  Perhaps something like it  
would be useful included in the standard libraries.

Cheers, David

Attachment (EnumSet.hs): application/octet-stream, 10 KiB

--------------------------------
David F. Place
mailto:d <at> vidplace.com

_______________________________________________
Haskell-Cafe mailing list
(Continue reading)

Frederik Eaton | 3 Apr 15:56 2006
Picon

generics question 2

Hi Ralf,

I'm looking for a function like extT but with more general type:

(t a -> s a) -> (t b -> s b) -> (t a -> s a)

Is there such a thing in the generics library?

Thanks,

Frederik

--

-- 
http://ofb.net/~frederik/
Jean-Philippe Bernardy | 3 Apr 16:02 2006
Picon

Re: Efficient Sets for Small Enumerations

David F. Place <d <at> vidplace.com> writes:

I'm currently writing and evolution to the standard collection package that can 
be found here:

http://darcs.haskell.org/packages/collections/

We integrate your module there. What would you say?

Cheers,
JP.
Christopher Brown | 3 Apr 16:41 2006
Picon

Strafunski

Hi,

I am trying to use Strafunski with GHC 6.5 and was wondering if  
someone could help me. I have all the instances for Term and Typeable  
defined for my data types, but when I try to compile with GHC 6.5 I  
get lots of "overlapping instance" errors. In particular, it seems  
the instances I am using (generated by DrIFT) are clashing with the  
ones in Data.Typeable. Is there a way I can fix this?

Also I have heard that it is possible to add "deriving Typeable" to  
each data type and I don't need to use the instances I have created.  
However, now it complains that it can't find instances for Term - but  
I can't derive from Term. Does anyone have any ideas how I can get  
Strafunski working with GHC 6.5?

Thanks.

Chris.

Christopher Brown
PhD Student, University of Kent.
http://www.cs.kent.ac.uk/people/rpg/cmb21/
cmb21 <at> kent.ac.uk

Gmane