Skip to content
Discussions/App Development/Which subset of Haskell is available?Forum ↗

Which subset of Haskell is available?

App Development6 posts543 views10 likesLast activity Feb 2021
AL
Alexander_BernauerOP
Feb 2021

Hi

the documentation (1) seems a bit weak when it comes to DAML language features that come from the Haskell heritage. For example, unless I have missed it, case expressions are not documented. It’s fair to refer to the Haskell documentation for this, but which version of Haskell and which language extensions are supported?

Concretely I would need to use some view patterns or pattern guards. Are those features supported?

Where can I find a list of all Haskell features that I can use in DAML?

Thanks,
Alex

(1) Language reference docs — Daml SDK 1.9.0 documentation

CO
cocreature
Feb 2021

We generally try to warn on anything that isn’t supported. View patterns are supported and are even turned on by default. Pattern guards are even enabled in Haskell by default those days and are also enabled and supported in Daml.

An example of unsupported extensions is PatternSynonyms or GADTs.

AN
anthony
Feb 2021

While likely not complete and someone will have a better answer than me you might also want to take a look at the sections in “An Introduction to Daml”.

And in Chapter 9, while case doesn’t have its own section it does have several examples of where and how it’s used.

CO
cocreature
Feb 2021

For case expressions, take a look at 3 Data types — Daml SDK 1.9.0 documentation for docs.

AL
Alexander_Bernauer
Feb 2021

Thanks, @cocreature.

Is there a list somewhere of supported and unsupported language extensions?

CO
cocreature
Feb 2021

There is no documented list atm but the source code isn’t too hard to understand if you know Haskell syntax (which you do if you’ve written Daml ;)) daml/Options.hs at 9dc3d2ace40931208c68f79dfc661f4106972560 · digital-asset/daml · GitHub

← Back to Discussions