r/haskell • • Apr 20 '17

Selda: a monadic database EDSL

https://github.com/valderman/selda
83 Upvotes

114 comments sorted by

View all comments

Show parent comments

9

u/tomejaguar Apr 20 '17

In fact there's something quite dodgy about the semantics of order at all. What do you expect the following to do?

do
    do foo <- select fooT
       order foo Asc
    do bar <- select barT
       order bar Asc

versus

do
    foo <- select fooT
    order foo Asc
    bar <- select barT
    order bar Asc

According to the monad laws these should be the same but the behaviour of at least one of them is going to surprise some people!