Presenting Matrix in Haskell [duplicate] - haskell

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Haskell linear algebra?
I am wondering whether is there any standard library to present a matrix and all its operators in Haskell? I am quite new to Haskell, so if you have experience handling with matrix, please give me some example if you can.

I don't have firsthand experience with it, but hmatrix is a go-to package for matrices in Haskell.
As for examples, there are dozens of good ones in the package file, in the "examples" directory. You can get the package file by running cabal unpack hmatrix, or just download it here.

Related

How to process arrow keys in CLI-based application, in Haskell? [duplicate]

This question already has answers here:
Haskell read raw keyboard input
(6 answers)
Closed 6 years ago.
I'm writing simple console Pomodoro timer (as my Haskell learning exercise):
Until that time menu was based on the prompt line. But now I want to replace it with arrow-based menu, like in Yeoman:
How can I do it in Haskell?
I read about System.Console.Terminfo.Keys and other System.Console packages, but not found solution for my question.
One way to do that would be to use bindings to ncurses library. Infact ncurses shows you an example of handing the key character "Q" in their sample program.
Another nice Haskell solution is vty-ui which has got a nice documentation to it.

writing a programmung language [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Suggestions for writing a programming language?
I have used many programming languages and after several years of experience I have finally decided to make a language with my friends. I know that this is a task not for the faint of heart. We are devoted to the task and are going to make sure that this gets completed.
Now I wanted to start off by asking: what are the steps to writing a programming language? What should we start off with (ex. The parser)?
Any answer is helpful!
If this is your first language, then work on all parts of it at the same time, start with a mini language spec and extend it feature by feature. Unless a its a domain specific language you should use a language that comes close to what you try to implement so that later you might be able to write a conversion tool to get a bootstrapping version of your compiler.

Haskell Linear Algebra Matrix Library for Arbitrary Element Types [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking for a Haskell linear algebra library that has the following features:
Matrix multiplication
Matrix addition
Matrix transposition
Rank calculation
Matrix inversion is a plus
and has the following properties:
arbitrary element (scalar) types (in particular element types that are not Storable instances). My elements are an instance of Num, additionally the multiplicative inverse can be calculated. The elements mathematically form a finite field (𝔽2256). That should be enough to implement the features mentioned above.
arbitrary matrix sizes (I'll probably need something like 100x100, but the matrix sizes will depend on the user's input so it should not be limited by anything else but the memory or the computational power available)
as fast as possible, but I'm aware that a library for arbitrary elements will probably not perform like a C/Fortran library that does the work (interfaced via FFI) because of the indirection of arbitrary (non Int, Double or similar) types. At least one pointer gets dereferenced when an element is touched
(written in Haskell, this is not a real requirement for me, but since my elements are no Storable instances the library has to be written in Haskell)
I already tried very hard and evaluated everything that looked promising (most of the libraries on Hackage directly state that they wont work for me). In particular I wrote test code using:
hmatrix, assumes Storable elements
Vec, but the documentation states:
Low Dimension : Although the dimensionality is limited only by what GHC will handle, the library is meant for 2,3 and 4 dimensions. For general linear algebra, check out the excellent hmatrix library and blas bindings
I looked into the code and the documentation of many more libraries but nothing seems to suit my needs :-(.
Update
Since there seems to be nothing, I started a project on GitHub which aims to develop such a library. The current state is very minimalistic, not optimized for speed at all and only the most basic functions have tests and therefore should work. But should you be interested in using or helping out developing it: Contact me (you'll find my mail address on my web site) or send pull requests.
well, I'm note really sure how much relevant my answer is but Im having good experiences with GNU GSL library and there is a wrapper for haskel:
http://hackage.haskell.org/package/bindings-gsl
Check it out, maybe it will help you

Is there anything like Haskell generic programming for F#? [duplicate]

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
Scrap Your Boilerplate in f#
I'm missing the sort generic traversal and transformation libraries that I have in Haskell when I'm working in F#.
Has anyone looked at doing something like Uniplate/Biplate for F#?
There's a brief mention in the comments of one of Neil Mitchell's blog posts, but I never found any further development:
http://neilmitchell.blogspot.com/2008/09/general-updates.html
I imagine you could build something on .NET reflection instead of type-classes, but I don't want to dig too deep without looking at prior art.
See
Scrap Your Boilerplate in f#

Simple Haskell graphics library? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'd like to experiment with Haskell a bit, and I'm hoping to write a small 2D arcade game (Tetris or Breakout).
Can you recommend a simple graphics library that will help me to get started quickly?
Btw, I've been experimenting with SDL and wxWidgets, but haven't yet succeeded in running any samples because of dependency problems, working on it...
It's not exactly a "simple" library, but there is a lot of information online about OpenGL and GLUT, as well as some very good tutorials and a ton of example code.
The biggest issue you're up against is that the OpenGL and GLUT bindings in Haskell do not include the libraries that they bind to. (This is true for wxWidgets as well.) A lot of Linux distros come with OpenGL binaries bundled, but not Windows. The Haskell Platform was supposed to fix this, but it didn't seem to for me.
So, assuming you're installing on Windows, here's what I'd recommend you try:
Follow the directions in this blog to the letter. They're complicated -- involving installs of MinGW, MSys, and hand-compilation of a GLUT project from SourceForge, but it's the only way I've gotten OpenGL to work. I've now successfully installed on three separate machines, including XP and Vista, so I can safely say that these are very good directions.
Once it does work, check out these two awesome tutorials. They really opened my eyes about just how powerful Haskell can be when it comes to graphics. You'll find the code involved a lot simpler than you may have anticipated.
Check out the sample games on the Haskell OpenGL page. They're very experimental -- which is good, as it means less code to wade through than you'll find in a production system -- but they're also surprisingly sophisticated. (And yes, there's already more than one bare-bones Tetris implementation, but don't let that stop you.)
Another good source of sample code is Haskell's GLUT binding itself. Look for the examples directory and you'll find many ports of sample code from the OpenGL Red Book.
OpenGL is very stateful, so you may find the Haskell code a little daunting if you haven't fully grokked Monads yet. I'm using my OpenGL experiments as motivation to finally wrap my mind around the concept.
Good luck!
Have you perused the following lists:
Haskell Graphics Libraries:
There appears to be quite a few interfaces to OpenGL, SDL, and other graphic libs here.
Haskell GUI:
There's some wxWidget libs here as well.
Cairo Is written in C but has haskell bindings, Perhaps trying that might be a good idea. Ive only ever used its python bindings but those seemed to work well.

Resources