[Haskell-cafe] Proposal: New syntax for Haskell

Niklas Hambüchen mail at nh2.me
Tue Sep 10 09:30:41 CEST 2013


Impressed by the productivity of my Ruby-writing friends, I have
recently come across Cucumber: http://cukes.info


It is a great tool for specifying tests and programs in natural
language, and especially easy to learn for beginners.

I propose that we add a Cucumber syntax for Haskell, with the extension
".chs", next to .hs and .lhs.


Code written in cucumber syntax is concise and easy to read: You can
find some example code in https://gist.github.com/nh2/6505995. Quoting
from that:

  Feature: The Data.List module

    In order to be able to use lists
    As a programmer
    I want a module that defines list functions

    Scenario: Defining the function foldl
      Given I want do define foldl
      Which has the type (in brackets) a to b to a (end of brackets),
                         to a, to list of b, to a
      And my arguments are called f, acc, and l
      When l is empty
      Then the result better be acc
      Otherwise l is x cons xs
      Then the result should be foldl f (in brackets) f acc x
                                (end of brackets) xs


PS: People even already started a testing framework for Haskell in it:
https://github.com/sol/cucumber-haskell#cucumber-for-haskell




More information about the Haskell-Cafe mailing list