Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code sharing in School of Haskell

Tags:

haskell

I looked through the tutorial on School of Haskell and maybe I missed it but I did not see how to share code between active Haskell elements?

For example in the below a is shared between two other active Haskell elements.

``` active haskell shared
a = 2
```

``` active haskell
mian = print $ "a: " ++ show a
```

``` active haskell
b = 3
mian = print $ "a*b: " ++ show (a*b)
```

This would allow an author to add comments to a ghci like session with out considerable code repetition.

The BlogLiterately-diagrams package offers such functionality as you can see in the example on it's hackage page.

like image 694
Davorak Avatar asked Oct 17 '25 02:10

Davorak


1 Answers

You didn't miss anything: the feature does not currently exist. We're planning on adding it in not too long.

like image 98
Michael Snoyman Avatar answered Oct 18 '25 18:10

Michael Snoyman