hi i was trying to solve it but
All i got is
type Matrix=[[Double]]
multMM :: Matrix -> Matrix -> Matrix --multiplies two matrices
multMM m t =[[sum (zipWith (*) (head m)(a)) ] ]where a = [head a | a<-
t]
Main> multMM [[2,1,-6],[1,-3,2]] [[1,0,-3],[0,4,20],[-2,1,1]]
[[14.0]]
from this i
Looking at (for example) the docs for 'bracket'[1], the parameter
documentation has been "shifted" up by one. The source code[2] looks
correct, so perhaps Haddock is parsing it incorrectly? Docs for other
functions, such as 'showSigned'[3], exhibit the same error.
[1]
http://www.haskell.org/ghc/d
Gregory Crosswhite writes:
> On Feb 2, 2010, at 7:11 PM, Jon Harrop wrote:
>
>> I doubt programming paradigms live or die according to whether or not they
>> can
>> implement Conway's Game of Life simply and efficiently.
>
> This makes an awesome quote. :-)
You mean Jon actually said somethin
On Tue, Feb 2, 2010 at 7:33 PM, Gregory Crosswhite <
gcr...@phys.washington.edu> wrote:
> On Feb 2, 2010, at 7:11 PM, Jon Harrop wrote:
>
> > I doubt programming paradigms live or die according to whether or not
> they can
> > implement Conway's Game of Life simply and efficiently.
>
> This makes
On Feb 2, 2010, at 7:11 PM, Jon Harrop wrote:
> I doubt programming paradigms live or die according to whether or not they
> can
> implement Conway's Game of Life simply and efficiently.
This makes an awesome quote. :-)
- Greg
___
Haskell-Cafe mail
Hello Victor,
2010/2/2, Victor Nazarov :
> I've been writing some GUI application with Gtk2hs. It's an
> interpreter for lambda-calculus and combinatory logic, it's GPL and if
> you interested I can share it with cafe.
Sure, why not?
> I consider more lightweight and more imperative approach, so
On Wednesday 03 February 2010 01:08:33 Richard O'Keefe wrote:
> On Feb 3, 2010, at 3:04 PM, Jon Harrop wrote:
> > Fair enough. If you want to model either an infinite board or a very
> > sparse one then a sparse data structure will be asymptotically faster. But
> > they won't be simpler and asympto
This is identical to the homework problem posted on stackoverflow:
http://stackoverflow.com/questions/2182300/haskell-matrix-scalar-multilple-question
Do not post homework problems to the cafe!
If you feel compelled to then identify an aspect that is tricky to
you, show us what you tried, and id
On Tuesday 02 February 2010 18:44:25 David Leimbach wrote:
> On Tue, Feb 2, 2010 at 11:54 AM, Jon Harrop wrote:
> > I meant the scalability and speed. An imperative solution should be
> > simpler, more scalable and faster than any purely functional solution.
>
> That's a pretty strange comment. W
On 3 Feb 2010, at 02:04, Jon Harrop wrote:
On Tuesday 02 February 2010 23:54:58 Richard O'Keefe wrote:
One message in this thread has already pointed to a
solution (in C) that in effect uses a bit-packed sparse
representation
to achieve high speed. The point is that that approach takes time
man writes:
> http://hackage.haskell.org/package/hmatrix-0.8.1.1
>
> it wraps gls, blas and lapack (so you need to install the libraries).
There's also the blas package if you just want blas support.
--
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com
___
Neil Mitchell writes:
> However, every time I use (1) some distro (usually Arch) emails me to
> say they need wider ranges so they can get all their packages
> consistent.
Well, in Gentoo we normally resort to using sed to fix these kinds of
things. If we can do it, I'm sure the Arch package man
On Tuesday 02 February 2010 23:54:58 Richard O'Keefe wrote:
> I understood the ""simple but not scalable and not particularly fast"
> claim *NOT* as a claim about imperative languages but in context as
> a claim about using two-dimensional arrays of booleans to implement
> Conway's Life.
Fair enou
On Tue, Feb 2, 2010 at 4:41 PM, Magnus Therning wrote:
> network-fancy fails to build because "Not in scope: 'setNonBlockingFD'".
> Any
> pointers to what should be used in 6.12?
>
I have the following in 'network':
#if __GLASGOW_HASKELL__ < 611
System.Posix.Internals.setNonBlockingFD fd
#
network-fancy fails to build because "Not in scope: 'setNonBlockingFD'". Any
pointers to what should be used in 6.12?
/M
--
Magnus Therning(OpenPGP: 0xAB4DFBA4)
magnus@therning.org Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter:
fac n = let { f = foldr (*) 1 [1..n] } in f
VERY interesting :)
Jinjing Wang wrote:
>
> fac n = let {
> f = foldr (*) 1 [1..n]
> } in f
>
> :D
>
> sorry for double reply, need to cc cafe, this is fun.
>
> On Tue, Feb 2, 2010 at 4:33 PM, zaxis wrote:
>>
>> thanks for all suggestions.
>>
Thanks for the replies.
I have heard of Hash Life, but I thought I'd try a more naive approach
first, build up some type-classes, then create some more interesting
implementations (although I think I'd struggle with implementing Hash
Life in haskell at this point).
> What is the meaning of fuzzy
Hi all,
I wonder if there is some a "field of use" overlap between HList and
functional references aka accessors.
Do both tackle the same problem?
Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listin
I understood the ""simple but not scalable and not particularly fast"
claim *NOT* as a claim about imperative languages but in context as
a claim about using two-dimensional arrays of booleans to implement
Conway's Life. One message in this thread has already pointed to a
solution (in C) that in
On Feb 3, 2010, at 1:15 AM, 조광래 wrote:
define functions
type Matrix=[[Double]]
multMM :: Matrix -> Matrix -> Matrix --multiplies two matrices
det :: Matrix -> Double --computes the determinant of a matrix
inv :: Matrix -> Matrix --inverts a matrix
i stuck on those problems
Stuck how, exact
2010/1/31 Malcolm Wallace :
> Both of these roles are called "mentor" in the Google system. Putting
> together a good team of mentors before applying as an organisation is
> helpful towards us being accepted into the programme.
Having experienced being a student on the SoC program, I'd be happy t
On Tue, Feb 2, 2010 at 5:11 PM, Johan Tibell wrote:
> On Tue, Feb 2, 2010 at 2:06 PM, Neil Mitchell wrote:
>>
>> I'd also be happy to mentor. Where is the official place to collect
>> project ideas? We used trac previously, are we still using it or are
>> we now on Reddit?
>
> Is there a way to p
>> Alternatively, if I could sign up to be emailed when something went
>> wrong, I'd happily fix it. i.e. I'd like an email either when my
>> package fails to compile against the latest version of all packages
>> but within my constrained range, or when the latest version falls
>> outside my constr
Apologies for the rather garbled last message (I was trying to type
whilst checking a multitude of links in a plethora or browser
windows)...
The SYB papers are here
http://research.microsoft.com/en-us/um/people/simonpj/Papers/hmap/
The code seems to have vanished at the moment, maybe someone ha
On Tue, Feb 2, 2010 at 11:11 PM, Neil Mitchell wrote:
>
> Alternatively, if I could sign up to be emailed when something went
> wrong, I'd happily fix it. i.e. I'd like an email either when my
> package fails to compile against the latest version of all packages
> but within my constrained range,
A few days ago I changed the links from the SYB wiki [1] to point to an
archived version of the vu.nl webpage:
http://web.archive.org/web/20080622204226/http://www.cs.vu.nl/boilerplate/
But it would be nice to have the webpage up again, somewhere.
Cheers,
Pedro
[1] http://www.cs.uu.nl/wiki/bin/
Hello
The most of the papers the Wikipedia page links to should be publicly
accessible, I've just checked the ones hosted at Utrecht University
(e.g the Generic Haskell manual and Andres L\ohs thesis). Ralf Hinze
has changed universities, so the link to
http://www.informatik.uni-bonn.de/~ralf/publ
On Tue, 2 Feb 2010, ed...@ymonad.com wrote:
> http://dotat.at/prog/life/hslife.hs
Er, yes, I didn't link to that in my earlier message because it's a
half-completed attempt. I think I got to the stage of realising that I
needed to write a monad or a monad transformer to thread the hash cons
state
I emailed Simon Peyton Jones about this a few weeks ago (he links to
these pages) and got the reply "thanks, will chase" - so people are
aware of it. The links are in many places, which is a bit of a shame.
Thanks, Neil
On Tue, Feb 2, 2010 at 8:51 PM, Arne Dehli Halvorsen wrote:
>
> I have tried
On Tue, Feb 2, 2010 at 2:06 PM, Neil Mitchell wrote:
> I'd also be happy to mentor. Where is the official place to collect
> project ideas? We used trac previously, are we still using it or are
> we now on Reddit?
Is there a way to prune the reddit list? Some of the projects (like 'text')
are a
Hi,
I maintain the Haskell package HLint. HLint depends on
haskell-src-exts, cpphs, hscolour and uniplate, plus things which are
shipped with GHC. For each of the external library dependencies, I
have to specify a version constraint. For example, I developed HLint
against cpphs-1.10 so I can write
Although now that I think about it, most of these could be pretty
easily fixed by a new primitive:
> splitGen :: Gen a -> Gen a
> splitGen m = MkGen spg where
>spg g n = (a, g2) where
>(g1, g2) = split g
>(a, _) = unGen m g1 n
Then you could do
>infinite_xs <- splitGen $
I'd also be happy to mentor. Where is the official place to collect
project ideas? We used trac previously, are we still using it or are
we now on Reddit?
Thanks, Neil
2010/2/1 sterl :
> Malcolm Wallace wrote:
>>
>> Google has announced that the Summer of Code programme will be running again
>>
On Tue, Feb 2, 2010 at 11:25 AM, David Menendez wrote:
> We could avoid that problem by redefining Gen as a state transformer monad.
>
> newtype Gen a = MkGen { unGen :: StdGen -> Int -> (a, StdGen) }
Unfortunately, this makes things like
> infinite_xs <- sequence (repeat arbitrary)
no longer wo
http://dotat.at/prog/life/hslife.hs
[],
Edgar
On Tue, 02/Feb/2010 at 21:10 +0100, Arne D Halvorsen wrote:
>
> Den 2. feb. 2010 kl. 19.26 skrev Jon Harrop :
>
> >On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote:
> >>Actually, your solution with arrays is the most often occured
> >>solu
On Tue, 2 Feb 2010, Serguey Zefirov wrote:
>
> Creation of new Array is (without knowing some subtle details) is
> O(max coordinates difference between live cells). Creation of new Set
> (X,Y) is O(NlogN) (N = number of live objects). Most of the cells in
> Life are empty, so the Set/Map approach i
On Tue, 2 Feb 2010, Arne D Halvorsen wrote:
>
> If I may butt in here: to get a scalable, fast Game of Life, you should look
> into Hashlife (by Gosper?) as exemplified in the open source application
> Golly. It gives an astonishing speedup, and it would be interesting to see it
> expressed in Hask
I have tried to access a few of the documents on generics that are referred
to from wikipedia, from the GHC documentation, from hackage and from the
wiki. These documents (on vu.nl, subdirectory boilerplate and strafunski)
are apparently forbidden to me, and have been for some weeks. I tried to
mai
On Tue, Feb 2, 2010 at 20:25, David Menendez wrote:
> On Tue, Feb 2, 2010 at 1:48 PM, Ryan Ingram wrote:
> > Gen slightly breaks the monad laws:
> >
> >> arbitrary >>= return
> > is not the same as
> >> return () >>= const arbitrary
> > because each bind splits the generator, so you end up with a
Mark Spezzano chariot.net.au> writes:
>
> Maybe there are books on Discrete maths or Algebra or Set Theory that deal
more with Hom Sets and Hom Functions?
>
Googling "haskell category theory" I got:
http://en.wikibooks.org/wiki/Haskell/Category_theory
http://www.haskell.org/haskellwiki/Categ
I have tried to access a few of the documents on generics that are
referred to from wikipedia, from the GHC documentation, from hackage
and from the wiki. These documents (on vu.nl, subdirectory boilerplate
and strafunski) are apparently forbidden to me, and have been for some
weeks. I trie
Den 2. feb. 2010 kl. 19.26 skrev Jon Harrop :
On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote:
Actually, your solution with arrays is the most often occured
solution
an imperative programmer will come with. It is simple but not
scalable
and not particularly fast.
What gave you
On Tue, Feb 2, 2010 at 1:48 PM, Ryan Ingram wrote:
> Gen slightly breaks the monad laws:
>
>> arbitrary >>= return
> is not the same as
>> return () >>= const arbitrary
> because each bind splits the generator, so you end up with a different
> seed passed to arbitrary in these two cases.
>
> If th
On Tue, Feb 2, 2010 at 1:59 PM, wrote:
> OK, I'm working on matrix stuff in Haskell now (I've been trying to get
> the professor to approve that) and when I use cabal install to install
> hmatrix, it fails at HUnit with:
> ---
> Configuring HUnit-1.2.2.1...
> Preprocessing library HUnit-1
OK, I'm working on matrix stuff in Haskell now (I've been trying to get
the professor to approve that) and when I use cabal install to install
hmatrix, it fails at HUnit with:
---
Configuring HUnit-1.2.2.1...
Preprocessing library HUnit-1.2.2.1...
Preprocessing executables for HUnit-1.2.2.1
Gen slightly breaks the monad laws:
> arbitrary >>= return
is not the same as
> return () >>= const arbitrary
because each bind splits the generator, so you end up with a different
seed passed to arbitrary in these two cases.
If the observable value is "some random object" this is a safe fudge,
b
leimy2k:
>
>
> On Tue, Feb 2, 2010 at 11:54 AM, Jon Harrop wrote:
>
> On Tuesday 02 February 2010 18:23:59 Serguey Zefirov wrote:
> > 2010/2/2 Jon Harrop :
> > > On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote:
> > >> Actually, your solution with arrays is the most of
2010/2/2 Jon Harrop :
>> Or, you're asking about scalability and speed?
>
> I meant the scalability and speed. An imperative solution should be simpler,
> more scalable and faster than any purely functional solution.
So, please, provide any and we'll discuss difference between ours.
Mine is here:
On Tue, Feb 2, 2010 at 11:54 AM, Jon Harrop wrote:
> On Tuesday 02 February 2010 18:23:59 Serguey Zefirov wrote:
> > 2010/2/2 Jon Harrop :
> > > On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote:
> > >> Actually, your solution with arrays is the most often occured solution
> > >> an impe
On Tuesday 02 February 2010 18:23:59 Serguey Zefirov wrote:
> 2010/2/2 Jon Harrop :
> > On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote:
> >> Actually, your solution with arrays is the most often occured solution
> >> an imperative programmer will come with. It is simple but not scalable
2010/2/2 Jon Harrop :
> On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote:
>> Actually, your solution with arrays is the most often occured solution
>> an imperative programmer will come with. It is simple but not scalable
>> and not particularly fast.
>
> What gave you that impression?
D
2010/2/2 Lyndon Maydwell :
> I'm avoiding hard-coding bools anywhere as I intend to allow
> fuzzy-representations at some point.
What is the meaning of fuzzy Game of Life? Where can I read about?
Or you're planning to average field over some time interval?
In the latter case you still will be fa
Hi,
"Hat": The Haskell Tracer.
http://www.haskell.org/hat/
>From the site:
Hat helps locating errors in programs. Furthermore, it is useful for
understanding how a (correct) program works, especially for teaching and
program maintenance. Hat is not a time or space profiler. Hat can be used
for pr
2010/2/2 Álvaro García Pérez
> You may try Pierce's "Basic Category Theory for Computer Scientists" or
> Awodey's "Category Theory", whose style is rather introductory. Both of them
> (I think) have a chapter about functors where they explain the Hom functor
> and related topics.
>
I think Awode
On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote:
> Actually, your solution with arrays is the most often occured solution
> an imperative programmer will come with. It is simple but not scalable
> and not particularly fast.
What gave you that impression?
--
Dr Jon Harrop, Flying Frog
http://hackage.haskell.org/package/hmatrix-0.8.1.1
it wraps gls, blas and lapack (so you need to install the libraries).
On Tue, Feb 2, 2010 at 4:08 PM, Job Vranish wrote:
> I have a little haskell matrix library for fixed sized matricies on github:
> http://github.com/jvranish/VectorMatix
> wh
I'm avoiding hard-coding bools anywhere as I intend to allow
fuzzy-representations at some point.
On Wed, Feb 3, 2010 at 12:10 AM, Serguey Zefirov wrote:
> 2010/2/2 Lyndon Maydwell :
>> I chose the array mainly for the fast lookup time compared to lists,
>> are you suggesting something like creat
2010/2/2 Lyndon Maydwell :
> I chose the array mainly for the fast lookup time compared to lists,
> are you suggesting something like creating a "Map (X,Y) Health"? I'm
> not currently updating any structures, rather creating the successor
> from scratch. I can see how the map may work very well fo
I chose the array mainly for the fast lookup time compared to lists,
are you suggesting something like creating a "Map (X,Y) Health"? I'm
not currently updating any structures, rather creating the successor
from scratch. I can see how the map may work very well for the sparse
nature of non-early li
2010/2/2 Lyndon Maydwell :
> Hi Cafe.
>
> I've made a basic game of life implementation with Haskell and OpenGL:
> https://github.com/sordina/Life/
>
> I'm intending to improve the performance, and add more advanced
> features, but I thought I'd get some feedback first. Can anyone see a
> way to ma
Hi Cafe.
I've made a basic game of life implementation with Haskell and OpenGL:
https://github.com/sordina/Life/
The basic premise is to generate a random snapshot, then iterate the
successor function on it to create an infinite list of snapshots, then
output them using OpenGL. I haven't really r
Hello,
I've been writing some GUI application with Gtk2hs. It's an
interpreter for lambda-calculus and combinatory logic, it's GPL and if
you interested I can share it with cafe.
The problem is that the GUI code has become very ugly and I'm tempted
to rewrite it totally. I've been looking forward
I have a little haskell matrix library for fixed sized matricies on github:
http://github.com/jvranish/VectorMatix
which I've just realized is horribly out of date...I'll update it tonight
and probably push it to hackage too...
but if you're really want to stick with the [[Double]] type,
you can a
Hi all,
I was wondering if someone has written a tracer/debugger that shows you
how a given Haskell expression is evaluated, by generating all the
intermediate states of the expression until it is in normal form?
For instance, given the following code:
> take' 0 xs = []
> take' n (x:xs) = x : ta
Mark Spezzano wrote:
I need a text for a newbie.
While the other books suggested are excellent, I think that they would
be hard going if you find Barr & Wells difficult.
The simplest introduction to the ideas of category theory that I know is
"Conceptual Mathematics" by F W Lawvere & S H Sc
You may try Pierce's "Basic Category Theory for Computer Scientists" or
Awodey's "Category Theory", whose style is rather introductory. Both of them
(I think) have a chapter about functors where they explain the Hom functor
and related topics.
Alvaro.
2010/2/2 Mark Spezzano
> I should probably
Correction about the latter part...
> In the end, I would write something like the following:
>
> unGen arbitrary (mkStdGen 11) 5 :: [Int]
>>
>
> This produces, for example, [5,1,-2,-4,2]. I also want to generate the same
> value for a type isomorphic to [Int].
>
> unGen arbitrary (mkStdGen 11) 5
On 2 Feb 2010, at 13:15, 조광래 wrote:
define functions
type Matrix=[[Double]]
multMM :: Matrix -> Matrix -> Matrix --multiplies two matrices
det :: Matrix -> Double --computes the determinant of a matrix
inv :: Matrix -> Matrix --inverts a matrix
i stuck on those problems
can any one help me o
define functions
type Matrix=[[Double]]
multMM :: Matrix -> Matrix -> Matrix --multiplies two matrices
det :: Matrix -> Double --computes the determinant of a matrix
inv :: Matrix -> Matrix --inverts a matrix
i stuck on those problems
can any one help me out?
___
> From: haskell-cafe-boun...@haskell.org
> [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of zaxis
> >
> > For me i like C style instead of layout. For example,
> > func1 a = do {
> > -- ...;
> >a * 2;
> > -- ...;
> > }
The report has all the gory details. The brace+semicolon synta
Hom(A, B) is just a set of morphisms from A to B.
Mark Spezzano wrote:
I should probably add that I am trying various proofs that involve injective
and surjective properties of Hom Sets and Hom functions.
Does anyone know what Hom stands for?
I need a text for a newbie.
Mark
On 02/02/2010,
I should probably add that I am trying various proofs that involve injective
and surjective properties of Hom Sets and Hom functions.
Does anyone know what Hom stands for?
I need a text for a newbie.
Mark
On 02/02/2010, at 9:56 PM, Mark Spezzano wrote:
> Hi all,
>
> I'm trying to learn Haske
fac n = let {
f = foldr (*) 1 [1..n]
} in f
:D
sorry for double reply, need to cc cafe, this is fun.
On Tue, Feb 2, 2010 at 4:33 PM, zaxis wrote:
>
> thanks for all suggestions.
>
>
> zaxis wrote:
>>
>> For me i like C style instead of layout. For example,
>> func1 a = do
>> -- ...
>>
Hi all,
I'm trying to learn Haskell and have come across Monads. I kind of understand
monads now, but I would really like to understand where they come from. So I
got a copy of Barr and Well's Category Theory for Computing Science Third
Edition, but the book has really left me dumbfounded. It's
|multSM d m = [[(b*a)| b<-[d], a<-(head m)]]
Well, let's see what do we have here.
We have []'s around something. "Something" is [(b*a)| b<-[d], a<-(head m)], which is just a legal Haskell value, so our "mutlSM d m" has to be a one-element list, with the only element being equal to
what we pu
Hi,
Try to understand this:
type Matrix = [[Double]]
multSM :: Double -> Matrix -> Matrix
multSM d m = map (\ i -> map (\ j -> d*j ) i) m
Now try this for multSM (instead of the above definition)
multSM = map . map . (*)
Hope it helps,
On 2 February 2010 09:35, 조광래 wrote:
>
> hi I have a
hi I have a question about haskell coding.
Matrices
One of many ways to define matrices in Haskell is the list of matrix rows,
where a row is a list of double precision oating point numbers:
type Matrix=[[Double]]
Using this type you should define the following functions (definition of dim
is g
On 2 Feb 2010, at 03:05, Richard O'Keefe wrote:
A simple hash-function for strings is to simply exclusive-or the
bytes and then reduce modulo a prime number,
Simply exclusive-oring the bytes will give you at most 256 distinct
results. (For an ASCII source, 128 distinct results.) After that,
thanks for all suggestions.
zaxis wrote:
>
> For me i like C style instead of layout. For example,
> func1 a = do
> -- ...
> a * 2
> -- ...
>
> I always write it as:
> func1 a = do {
> -- ...;
>a * 2;
> -- ...;
> }
>
> However, i donot know how to write pure function
79 matches
Mail list logo