Re: [Haskell-cafe] Chordify, a new web startup using Haskell

2013-01-18 Thread Alfredo Di Napoli
Congratulations!
Keep up the good work, especially in using Haskell at a commercial level :)

Bye!
Alfredo

On 18 January 2013 07:34, Alp Mestanogullari alpmes...@gmail.com wrote:

 That's awesome, works like a charm on the samples I've tried it on! Cheers
 to the Chordify team, I will use it and give any useful feedback if I have
 any.


 On Fri, Jan 18, 2013 at 12:07 AM, José Pedro Magalhães j...@cs.uu.nlwrote:

 Hi all,

 I'd like to introduce Chordify http://chordify.net/ [1], an online
 music player that extracts chords from musical sources like Soundcloud,
 Youtube or your own files, and shows you which chord to play when. Here's
 an example song:
 http://chordify.net/chords/passenger-let-her-go-official-video-passengermusic

 The aim of Chordify is to make state-of-the-art music technology
 accessible to a broader audience. Behind the scenes, Chordify uses the
 HarmTrace Haskell package to compute chords from audio. I've been working
 on this project with a couple of colleagues for a while now, and recently
 we have made the website public, free to use for everyone.

 We do not use Haskell for any of the frontend/user interface, but the
 backend is entirely written in Haskell (and it uses pretty advanced
 features, such as GADTs and type families [3]). We're particularly
 interested in user feedback at this stage, so if you're interested in music
 and could use an automatic chord transcription service, please try Chordify!


 Cheers,
 Pedro

 [1] http://chordify.net/
 [2] http://hackage.haskell.org/package/HarmTrace
 [3] José Pedro Magalhães and W. Bas de Haas. Functional Modelling of
 Musical Harmony: an Experience Report. In Proceedings of the 16th ACM
 SIGPLAN International Conference on Functional Programming (ICFP'11), pp.
 156–162, ACM, 2011. http://dreixel.net/research/pdf/fmmh.pdf


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




 --
 Alp Mestanogullari

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Chordify, a new web startup using Haskell

2013-01-18 Thread Thiago Negri
Is it possible to play the generated chords as a melody by itself, without
the original music over it?


2013/1/18 Alfredo Di Napoli alfredo.dinap...@gmail.com

 Congratulations!
 Keep up the good work, especially in using Haskell at a commercial level :)

 Bye!
 Alfredo


 On 18 January 2013 07:34, Alp Mestanogullari alpmes...@gmail.com wrote:

 That's awesome, works like a charm on the samples I've tried it on!
 Cheers to the Chordify team, I will use it and give any useful feedback if
 I have any.


 On Fri, Jan 18, 2013 at 12:07 AM, José Pedro Magalhães j...@cs.uu.nlwrote:

  Hi all,

 I'd like to introduce Chordify http://chordify.net/ [1], an online
 music player that extracts chords from musical sources like Soundcloud,
 Youtube or your own files, and shows you which chord to play when. Here's
 an example song:
 http://chordify.net/chords/passenger-let-her-go-official-video-passengermusic

 The aim of Chordify is to make state-of-the-art music technology
 accessible to a broader audience. Behind the scenes, Chordify uses the
 HarmTrace Haskell package to compute chords from audio. I've been working
 on this project with a couple of colleagues for a while now, and recently
 we have made the website public, free to use for everyone.

 We do not use Haskell for any of the frontend/user interface, but the
 backend is entirely written in Haskell (and it uses pretty advanced
 features, such as GADTs and type families [3]). We're particularly
 interested in user feedback at this stage, so if you're interested in music
 and could use an automatic chord transcription service, please try Chordify!


 Cheers,
 Pedro

 [1] http://chordify.net/
 [2] http://hackage.haskell.org/package/HarmTrace
 [3] José Pedro Magalhães and W. Bas de Haas. Functional Modelling of
 Musical Harmony: an Experience Report. In Proceedings of the 16th ACM
 SIGPLAN International Conference on Functional Programming (ICFP'11), pp.
 156–162, ACM, 2011. http://dreixel.net/research/pdf/fmmh.pdf


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




 --
 Alp Mestanogullari

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe



 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Petr P
  Dear Haskellers,

could somebody recommend me study materials for learning Hindley-Milner
type inference algorithm I could recommend to undergraduate students? The
original paper is harder to understand, I'm looking for something more
didactic. The students are familiar with the lambda calculus, natural
deduction and System F.

  Thanks for help,
  Petr Pudlak
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Vo Minh Thu
2013/1/18 Petr P petr@gmail.com:
   Dear Haskellers,

 could somebody recommend me study materials for learning Hindley-Milner type
 inference algorithm I could recommend to undergraduate students? The
 original paper is harder to understand, I'm looking for something more
 didactic. The students are familiar with the lambda calculus, natural
 deduction and System F.

I think I really liked

Cardelli's paper Basic Polymorphic Typechecking, 1987

HTH,
Thu

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: hgdbmi 0.2, GDB Machine Interface

2013-01-18 Thread Daniel Trstenjak

Hi Alexander,

On Thu, Jan 17, 2013 at 10:17:33PM +0100, Alexander Bernauer wrote:
 I am happy to announce the second release of hgdbmi, a Haskell
 implementation of the GDB Machine Interface.

Nice project! :)

 PS: This is my first serious Haskell package. If you see something
 that you consider odd, I might have done this simply because I didn't
 know better. I would appreciate if you would let me know in such a
 case.

Looking at the function names: have you got a c programming background?

Instead of using these prefixes you could put the functions into separate
modules.

If the interface depends on the GDB version, than it could make sense to
encode the GDB version into the module name, something like:
Gdbmi.V7_4.Commands


Greetings,
Daniel

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Anton Dergunov
 I also agree that Cardelli paper is great.

It was also very useful for me to follow Python implementation provided in the 
following blog post:
http://www.smallshire.org.uk/sufficientlysmall/2010/04/11/a-hindley-milner-type-inference-implementation-in-python/

I found it useful to investigate in Python debugger how various terms were 
interpreted.

You may also find useful implementations in Scala and Perl:
http://dysphoria.net/2009/06/28/hindley-milner-type-inference-in-scala/
http://web.archive.org/web/20050911123640/http://www.cs.berkeley.edu/~nikitab/courses/cs263/hm.html

Also, I have plans to read Typing Haskell in Haskell by Mark Jones and 
Practical type inference for arbitrary-rank types by Simon Peyton-Jones et. 
al. They are also related here, but not directly.

--
Best Regards,
Anton Dergunov

Пятница, 18 января 2013, 11:12 +01:00 от Vo Minh Thu not...@gmail.com:
2013/1/18 Petr P  petr@gmail.com :
   Dear Haskellers,

 could somebody recommend me study materials for learning Hindley-Milner type
 inference algorithm I could recommend to undergraduate students? The
 original paper is harder to understand, I'm looking for something more
 didactic. The students are familiar with the lambda calculus, natural
 deduction and System F.

I think I really liked

Cardelli's paper Basic Polymorphic Typechecking, 1987

HTH,
Thu

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: crypto-pubkey: all your public key crypto algorithms belong to us.

2013-01-18 Thread Vincent Hanquez
On Tue, Jan 15, 2013 at 03:27:29PM +0100, Ertugrul Söylemez wrote:
 Vincent Hanquez t...@snarc.org wrote:
 
  Yes, the performance are terrible in term of integers. As the library
  is specific to public key algorithm, i just can't reasonable work on
  64 bits integer :-), and multiprecision integers is the only way to
  go.
 
  I'm on-and-off working on some mutable mpi library to be able to
  define pure function that do the necessary stuff (i.e. expmod, mulmod,
  etc..)
 
  I'm hoping this could be reasonably competitive with a C mpi library,
  but time will tell.
 
 It's a waste of time.  In my benchmarks Haskell Integer outperformed
 equivalent (sane) C implementations using GMP's mpz_* interface.  You
 would be reinventing GMP's mpn_* interface and a custom memory manager
 to be able to match the speed of Integer.

I don't plan to match (or outperform) the speed of integer for simple
operations. My experiment is about overtaking haskell's Integer in composite
operations (mainly for non naive expmod) by operating with mutable integers and
direct access to the representation (the second point is somewhat what Daniel
is doing using integer-gmp).

One valid way to solve this problem, would be to export more GMP function to
haskell without wrapping them for referencial transparency. However the GMP
dependencies is not always welcome and the integration of GMP is slightly
special (primops), which is why i'm not taking this course of action.

 The things that were slower than equivalent C code were not related to
 Integer, but mostly to data structures like Set in my case, which was
 the motivation for me to write the 'quickset' library.

AFAIK, Haskell's Integer expmod algorithms have no way to rival with real world
implementation of expmod, which make all pubkey operations quite slow compare
to their C friends. There's also the question of timing security with a pure 
GCed interface.

-- 
Vincent

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: MFlow 0.2

2013-01-18 Thread Heinrich Apfelmus

Alberto G. Corona wrote:

Hello. haskellers and, specially, web developpers.

This is the second version of MFlow, a deep-first effort in the development
of a platform for web applications at the higher level, by including as
much haskell magic as possible. It is at the same time experimental and
intended to be used in industry. I believe that haskell will not have its
chance in the Web if it does not bring unique advantages and challenging
paradigms beyond speed and type safety.

Deep-first means that the effort is more in the addition higher level
features rather than in being complete and bug free, with the conviction
that feedback from real usage at the highest level is the best guide for
development.

Rather than to mimic other platforms in other languages, MFlow is as
Haskell'ish as possible, and introduces new approaches like  statefulness,
 event sourcing, back-execution, composable, active, self contained widgets
and persistent STM. All of them collaborate to create a high level
environment for web programming.

This release adds bidings for WAI, blaze-html, stateful AJAX, active
widgets,  requirements, content management, multilanguage and URLs to pages
inside stateful procedures.

The package:
[http://hackage.haskell.org/package/MFlow

The entry in my blog, with the announcement and the philosophy behind
http://haskell-web.blogspot.com.es/2013/01/announce-mflow-02.html


For some reason, your blog posts are not displayed in my browser 
(Chrome). I block all cookies and I'm using adblock, though.



Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: MFlow 0.2

2013-01-18 Thread Ertugrul Söylemez
Heinrich Apfelmus apfel...@quantentunnel.de wrote:

 For some reason, your blog posts are not displayed in my browser
 (Chrome). I block all cookies and I'm using adblock, though.

Blogger.com blogs often need JavaScript to display anything at all.


Greets,
Ertugrul

-- 
Not to be or to be and (not to be or to be and (not to be or to be and
(not to be or to be and ... that is the list monad.


signature.asc
Description: PGP signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Jan Stolarek
Dnia piątek, 18 stycznia 2013, Petr P napisał:
 for learning Hindley-Milner type inference algorithm I could recommend to
 undergraduate students? The original paper is harder to understand, I'm
 looking for something more didactic. The students are familiar with the
 lambda calculus, natural deduction and System F.

Perhaps chapters on H-M from Appel's Modern compiler implementation in C/Java 
would be good?

Janek

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Chordify, a new web startup using Haskell

2013-01-18 Thread Rustom Mody
On Fri, Jan 18, 2013 at 2:09 PM, Thiago Negri evoh...@gmail.com wrote:

 Is it possible to play the generated chords as a melody by itself, without
 the original music over it?


Super work!
I was meaning to ask something similar -- can we get out something of the
music that chordify has reverse engineered  -- maybe midi maybe musicxml?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Rustom Mody
On Fri, Jan 18, 2013 at 5:49 PM, Jan Stolarek jan.stola...@p.lodz.plwrote:

 Dnia piątek, 18 stycznia 2013, Petr P napisał:
  for learning Hindley-Milner type inference algorithm I could recommend to
  undergraduate students? The original paper is harder to understand, I'm
  looking for something more didactic. The students are familiar with the
  lambda calculus, natural deduction and System F.


What is the current opinion of Mark Jones Typing haskell in haskell?
http://web.cecs.pdx.edu/~mpj/thih/TypingHaskellInHaskell.html

[Note This is to add to the question more than the answer]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Stephen Tetley
There is a summary paper by Sunil Kothari and James L. Cladwell
covering the algorithms M, J and W with informal presentations plus
code available in Ocaml. Paper is on Citeseer, code is available from
Sunil Kothari's home page.

Martin Grabmueller has a tutorial implementation of algorithm W in Haskell:

http://www.grabmueller.de/martin/www/pub/pub.en.html

On 18 January 2013 10:06, Petr P petr@gmail.com wrote:
   Dear Haskellers,

 could somebody recommend me study materials for learning Hindley-Milner type
 inference algorithm I could recommend to undergraduate students?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: hgdbmi 0.2, GDB Machine Interface

2013-01-18 Thread Alexander Bernauer
Hi Daniel

thank you for your feedback.

On Fri, Jan 18, 2013 at 11:22 AM, Daniel Trstenjak
daniel.trsten...@gmail.com wrote:
 Looking at the function names: have you got a c programming background?
 Instead of using these prefixes you could put the functions into separate
 modules.

Although I do have some background in C programming, these naming
schemes are not my idea. Instead the function names match the names of
the corresponding GDB/MI commands. I thought it would make sense to
use these names for ease of reference. Given this, would you still
prefer them being grouped in separate modules?

 If the interface depends on the GDB version, than it could make sense to
 encode the GDB version into the module name, something like:
 Gdbmi.V7_4.Commands

Gdbmi.Commands is not the only module that depends on the GDB version.
GDB/MI is in general still evolving and GDB's compliance with the
documentation keeps on changing on all levels. So I would have to
maintain all hgdbmi modules for each GDB version. Do you think this
makes sense and is worth the effort?

Greetings, Alex

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] regular expression sub-expression matching

2013-01-18 Thread Nicolas Bock
Hello list,

I was wondering whether there is a way to do what the following python code
does in haskell:

import re

result = re.compile(M\(([0-9]+),([0-9]+)\) *=
*([0-9.eE-]+);).search(M(1,2) = 0.1e-3;)
if result:
  print(result.group(1), result.group(2), result.group(3))

Basically I would like to pattern match parts of a string and return the
matches. I have looked at Text.Regex.Posix but (of course I might just not
have understood the functions in there properly) it seems as if it does not
provide anything like python's re module.

Thanks already,

nick
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] regular expression sub-expression matching

2013-01-18 Thread Roman Cheplyaka
* Nicolas Bock nicolasb...@gmail.com [2013-01-18 16:25:31-0700]
 Hello list,
 
 I was wondering whether there is a way to do what the following python code
 does in haskell:
 
 import re
 
 result = re.compile(M\(([0-9]+),([0-9]+)\) *=
 *([0-9.eE-]+);).search(M(1,2) = 0.1e-3;)
 if result:
   print(result.group(1), result.group(2), result.group(3))
 
 Basically I would like to pattern match parts of a string and return the
 matches. I have looked at Text.Regex.Posix but (of course I might just not
 have understood the functions in there properly) it seems as if it does not
 provide anything like python's re module.

Take a look at the regex-applicative package.

http://hackage.haskell.org/packages/archive/regex-applicative/0.2.1/doc/html/Text-Regex-Applicative.html

Roman

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] regular expression sub-expression matching

2013-01-18 Thread Bob Ippolito
Note that Haskell doesn't convert \( to \\( like Python does, so the
regex string has been changed. It's not so easy to figure out how to use
this library from the documentation because of all the typeclass trickery.

h import Text.Regexp.Posix (getAllTextSubmatches, (=~))
h getAllTextSubmatches (M(1,2) = 0.1e-3; =~ M\\(([0-9]+),([0-9]+)\\) *=
*([0-9.eE-]+);) :: [String]
[M(1,2) = 0.1e-3;,1,2,0.1e-3]

If it doesn't match, you'll get an empty list. You can join the tail of the
match list together with Data.List.intercalate, and print it out with
putStrLn. The if null case would just return ().

To demonstrate some of the typeclass trickery going on here, you could ask
for the results as an Array with Int indexes of String.

h import Text.Regexp.Posix (getAllTextSubmatches, (=~))
h import Data.Array ((!), Array)
h let matches = getAllTextSubmatches (M(1,2) = 0.1e-3; =~
M\\(([0-9]+),([0-9]+)\\) *= *([0-9.eE-]+);) :: Array Int String
h matches
array (0,3) [(0,M(1,2) = 0.1e-3;),(1,1),(2,2),(3,0.1e-3)]
h map (matches !) [1..3]
[1,2,0.1e-3]

-bob

On Fri, Jan 18, 2013 at 3:25 PM, Nicolas Bock nicolasb...@gmail.com wrote:

 Hello list,

 I was wondering whether there is a way to do what the following python
 code does in haskell:

 import re

 result = re.compile(M\(([0-9]+),([0-9]+)\) *=
 *([0-9.eE-]+);).search(M(1,2) = 0.1e-3;)
 if result:
   print(result.group(1), result.group(2), result.group(3))

 Basically I would like to pattern match parts of a string and return the
 matches. I have looked at Text.Regex.Posix but (of course I might just not
 have understood the functions in there properly) it seems as if it does not
 provide anything like python's re module.

 Thanks already,

 nick


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread oleg

Petr Pudlak wrote:
 could somebody recommend me study materials for learning Hindley-Milner
 type inference algorithm I could recommend to undergraduate students? 

Perhaps you might like a two-lecture course for undergraduates, which
uses Haskell throughout

http://okmij.org/ftp/Haskell/AlgorithmsH.html#teval

It explained HM type inference in a slightly different way, strongly
emphasizing type inference as a non-standard interpretation. The
second main idea was relating polymorphism and `inlining' (copying).
Type schemas were then introduced as an optimization, to inlining. It
becomes clear why it is unsound to infer a polymorphic type for ref
[]: expressions of polymorphic types are always inlined (conceptually,
at least), which goes against the dynamic semantics of reference
cells.

The lectures also show how to infer not only the type but also the
type environment. This inference helps to make the point that `tests'
cannot replace typing. We can type check open expressions (and infer
the minimal environment they make sense to use in). We cannot run
(that is, dynamically check) open expressions.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe