What about extending haskell (or ghc) with mixfix operators, Agda style?. At
first sigth it would permit the creation of custom control structures and
perhaps more readable DSLs.
2009/6/25 Stephan Friedrichs
> Henning Thielemann wrote:
> > [...]
> >
> > http://haskell.org/haskellwiki/Case
>
> Ma
Henning Thielemann wrote:
> [...]
>
> http://haskell.org/haskellwiki/Case
Maybe we (i. e. someone with a wiki account ;) ) should add Jeremy's
proposal - using let and guards - to the page (under section 2.2,
"syntactic suger")? IMHO this is much clearer than "case () of _".
foo =
let x | 1
Deniz Dogan schrieb:
> 2009/6/20 Stephan Friedrichs :
>> Deniz Dogan wrote:
>>> I (too) often find myself writing code such as this:
>>>
>>> if something
>>> then putStrLn "howdy there!"
>>> else if somethingElse
>>> then putStrLn "howdy ho!"
>>> else ...
>>>
>>> [...]
http
I (too) often find myself writing code such as this:
if something
then putStrLn "howdy there!"
else if somethingElse
then putStrLn "howdy ho!"
else ...
1. recognize something odd. done.
2. look for improvements. good.
3. define suitable abstractions for your special case
4.
On Jun 20, 2009, at 14:05 , Deniz Dogan wrote:
if something
then putStrLn "howdy there!"
else if somethingElse
then putStrLn "howdy ho!"
else ...
FWIW, when I see this I generally start looking for a higher order way
to express it. The monoid instance for lists can be a g
Antoine Latter wrote:
> On Sat, Jun 20, 2009 at 1:05 PM, Deniz Dogan wrote:
>> I (too) often find myself writing code such as this:
>>
>> if something
>> then putStrLn "howdy there!"
>> else if somethingElse
>> then putStrLn "howdy ho!"
>> else ...
>>
>> I recall reading some tu
The when and unless functions might come in handy too (both have type
forall (m :: * -> *). (Monad m) => Bool -> m () -> m ())
On Sat, Jun 20, 2009 at 2:05 PM, Deniz Dogan wrote:
> I (too) often find myself writing code such as this:
>
> if something
> then putStrLn "howdy there!"
> else if some
On Sat, Jun 20, 2009 at 1:05 PM, Deniz Dogan wrote:
> I (too) often find myself writing code such as this:
>
> if something
> then putStrLn "howdy there!"
> else if somethingElse
> then putStrLn "howdy ho!"
> else ...
>
> I recall reading some tutorial about how you can use the
At Sat, 20 Jun 2009 20:45:16 +0200,
Stephan Friedrichs wrote:
> If it's a function, you can use guards:
>
> foo :: ...
> foo something somethingElse
> | something -> putStrLn "howdy there!"
> | somethingElse -> putStrLn "howdy ho!"
> | otherwise -> ...
You can also artificial
2009/6/20 Stephan Friedrichs :
> Deniz Dogan wrote:
>> I (too) often find myself writing code such as this:
>>
>> if something
>> then putStrLn "howdy there!"
>> else if somethingElse
>> then putStrLn "howdy ho!"
>> else ...
>>
>> [...]
>>
>> So how do I make code like this
Deniz Dogan wrote:
> I (too) often find myself writing code such as this:
>
> if something
> then putStrLn "howdy there!"
> else if somethingElse
> then putStrLn "howdy ho!"
> else ...
>
> [...]
>
> So how do I make code like this prettier?
If it's a function, you can us
I (too) often find myself writing code such as this:
if something
then putStrLn "howdy there!"
else if somethingElse
then putStrLn "howdy ho!"
else ...
I recall reading some tutorial about how you can use the Maybe monad
if your code starts looking like this, but as you ca
12 matches
Mail list logo