Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Problems with EclipseFP (Dmitry Simonchik)
2. Re: Problems with EclipseFP (Daniel Fischer)
3. I need advice on design (Amy de Buitl?ir)
4. Re: I need advice on design (Brent Yorgey)
5. Re: I need advice on design (Daniel Fischer)
6. Advice on what to install (Chris Saunders)
7. Re: Advice on what to install (Erlend Hamberg)
----------------------------------------------------------------------
Message: 1
Date: Mon, 28 Dec 2009 09:40:25 +0300
From: Dmitry Simonchik <[email protected]>
Subject: Re: [Haskell-beginners] Problems with EclipseFP
To: Maciej Piechotka <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
Hi
I installed eclipseFP just a couple of days ago. Everything seems to work
fine for me. I just followed instructions on eclipseFP homepage. Now my
Eclipse recognizes hs files and does correct syntax higlighting and is able
to report compilation errors on file save.
But actually after 10 mins of exploration I decided to switch back to my
previous editor (Kate) as it is more usefull for me :)
On Mon, Dec 21, 2009 at 12:23 AM, Maciej Piechotka <[email protected]>wrote:
> Did anyone used eclipsefp? I installed version 2 but I didn't change
> anything in eclipse (I haven't notice a difference - it does not
> recognise .hs file, nothing about haskell in help/new project/new file
> etc.).
>
> Regards
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20091228/c6239a58/attachment-0001.html
------------------------------
Message: 2
Date: Mon, 28 Dec 2009 09:56:35 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Problems with EclipseFP
To: Dmitry Simonchik <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-15"
Am Monday 28 December 2009 07:40:25 schrieben Sie:
> But actually after 10 mins of exploration I decided to switch back to my
> previous editor (Kate) as it is more usefull for me :)
Best IDE I know, Kate/Kwrite + ghci :D
I occasionally try something else (emacs+haskell-mode, leksah) but I always
return soon.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20091228/ab84b084/attachment-0001.html
------------------------------
Message: 3
Date: Mon, 28 Dec 2009 17:14:53 +0000
From: Amy de Buitl?ir <[email protected]>
Subject: [Haskell-beginners] I need advice on design
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
I'm building a library of components for artificial neural networks.
I'm used to object-oriented languages, so I'm struggling a bit to
figure out how to do a good design in a functional programming
language like Haskell.
Q1: I've come up with two designs, and would appreciate any advice on
improvements and what approach to take.
===== Design #1 =====
class Neuron n where
activate :: [Double] -> n -> Double
train :: [Double] -> Double -> n -> n
...and then I would have instances of this typeclass. For example:
data Perceptron = Perceptron {
weights :: [Double],
threshold :: Double,
learningRate :: Double
} deriving (Show)
instance Neuron Perceptron where
activate inputs perceptron = ...
train inputs target perceptron = ...
The disadvantage of this approach is that I need to define and name
each instance of neuron before I can use it. I'd rather create a
neuron on-the-fly by calling a general-purpose constructor and telling
it what functions to use for activation and training. I think that
would make it easier to re-use activation and training functions in
all sorts of different combinations. So I came up with...
===== Design #2 =====
data Neuron =
Neuron {
weights :: [Double],
activate :: [Double] -> Double,
train :: [Double] -> Double -> Neuron
}
Q2: I thought there might be some way to define a function type, but
the following doesn't work. Is there something along these lines that
would work?
type activationFunction = [Double] -> Double
------------------------------
Message: 4
Date: Mon, 28 Dec 2009 12:43:08 -0500
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] I need advice on design
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
On Mon, Dec 28, 2009 at 05:14:53PM +0000, Amy de Buitléir wrote:
> I'm building a library of components for artificial neural networks.
> I'm used to object-oriented languages, so I'm struggling a bit to
> figure out how to do a good design in a functional programming
> language like Haskell.
>
> Q1: I've come up with two designs, and would appreciate any advice on
> improvements and what approach to take.
>
> ===== Design #1 =====
> class Neuron n where
> activate :: [Double] -> n -> Double
> train :: [Double] -> Double -> n -> n
Looks reasonable.
> The disadvantage of this approach is that I need to define and name
> each instance of neuron before I can use it. I'd rather create a
> neuron on-the-fly by calling a general-purpose constructor and telling
> it what functions to use for activation and training.
Indeed, if you want to create new types of neurons on-the-fly you
should use your second design.
> ===== Design #2 =====
> data Neuron =
> Neuron {
> weights :: [Double],
> activate :: [Double] -> Double,
> train :: [Double] -> Double -> Neuron
> }
Mostly makes sense. Note that this is really making explicit what the
type class mechanism is doing -- a type class instance corresponds to
a "dictionary", a record of type class methods, which is implcitly
passed around. Here you are just explicitly declaring a dictionary
type for neurons.
The one thing that confuses me is why you included "weights" in the
explicit dictionary but not in the Neuron type class. I would think
you'd want it in both or neither, I don't see any reason you'd need it
in one but not the other.
> Q2: I thought there might be some way to define a function type, but
> the following doesn't work. Is there something along these lines that
> would work?
>
> type activationFunction = [Double] -> Double
Type names must start with an uppercase letter.
type ActivationFunction = [Double] -> Double
should work just fine.
-Brent
------------------------------
Message: 5
Date: Mon, 28 Dec 2009 19:10:12 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] I need advice on design
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Am Montag 28 Dezember 2009 18:14:53 schrieb Amy de Buitléir:
> I'm building a library of components for artificial neural networks.
> I'm used to object-oriented languages, so I'm struggling a bit to
> figure out how to do a good design in a functional programming
> language like Haskell.
I can't say what design would be best to implement neural networks in Haskell,
but
> Q2: I thought there might be some way to define a function type, but
> the following doesn't work. Is there something along these lines that
> would work?
>
> type activationFunction = [Double] -> Double
if the type name starts with a lower case letter, it's a type variable, so
you'd want
type ActivationFunction = [Double] -> Double
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20091228/0a6ced2f/attachment-0001.html
------------------------------
Message: 6
Date: Mon, 28 Dec 2009 14:58:39 -0500
From: "Chris Saunders" <[email protected]>
Subject: [Haskell-beginners] Advice on what to install
To: "Haskell - Beginners" <[email protected]>
Message-ID: <0fa52975b01f4a4687563947bb442...@chrispc>
Content-Type: text/plain; charset="iso-8859-1"
I noticed the availability of Haskell Platform 2009.2.0.2 and did install this
and when I run GHCi it says that its version is 6.10.4. Now on the GHC site I
notice that the current version is 6.12. Should I have installed this more
recent version or stick with what I have? Warning: many more dumb questions
to come from this guy.
Regards
Chris Saunders
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20091228/e95cbf45/attachment-0001.html
------------------------------
Message: 7
Date: Mon, 28 Dec 2009 21:04:09 +0100
From: Erlend Hamberg <[email protected]>
Subject: Re: [Haskell-beginners] Advice on what to install
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-15"
On Monday 28. December 2009 20.58.39 Chris Saunders wrote:
> Now on the GHC site I notice that the current version is 6.12. Should I
> have installed this more recent version or stick with what I have?
Stick with what you have. A new version of the Haskell Platform based on the
new GHC version won't be out for some time.
Welcome! :)
--
Erlend Hamberg
"Everything will be ok in the end. If its not ok, its not the end."
GPG/PGP: 0xAD3BCF19
45C3 E2E7 86CA ADB7 8DAD 51E7 3A1A F085 AD3B CF19
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url :
http://www.haskell.org/pipermail/beginners/attachments/20091228/0ca066b4/attachment.bin
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 18, Issue 29
*****************************************