[Haskell-cafe] Haskell newb trying to write a basic program.

Erik Rantapaa erantapaa at gmail.com
Fri May 27 00:36:49 UTC 2016


Have a look at the HaskellForMaths package.

Using the Math.Algebra.Group.PermutationGroup module the expression `elts 
(_A n)` will return all the permutations of A_n.

On Thursday, May 26, 2016 at 6:39:52 PM UTC-5, Blake Sims wrote:
>
> Hi,
>
> I am a newb to Haskell and programming in general, but I was trying to 
> write a basic program to find the elements for the alternating group for 
> any n.
>
> For the symmetric group I wrote something like this
>
> input Data.List
>
> symmetric n = permutations ([1..n])
>
> What if I just want to find the even permutations?  What is the quick and 
> dirty way of doing this?  I was looking at the package Data.Matrix and 
> messing around with permutation matrices, but there has got to be a quicker 
> and easier way of doing it. I am skimming the book learn you a Haskell, but 
> my attention span is pretty short so if someone could direct me in the 
> right direction I'd be much obliged.  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160526/ff3150f4/attachment.html>


More information about the Haskell-Cafe mailing list