Skip to content

Commit

Permalink
mult param bug fix and add an example file
Browse files Browse the repository at this point in the history
  • Loading branch information
dsvictor94 committed Jul 16, 2015
1 parent 7349b8d commit e9b8b02
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from pyhell import autoenable
from pyhell.hstypes import HaskellString, HaskellFunction
from Data.List import sort, take #import from haskell

two = HaskellFunction.from_string("2");
x = HaskellString(take(two, sort(HaskellString("pyhell"))))
#just checked the type and build the expression, it had not executed yet
print("the code", x.hs_code, "was not executed yet, simulating the lazily of Haskell: ", x._data)
print("now, when 'x' is direct accessed the code was evaluated and the result '", x, "' was cached to next use")

0 comments on commit e9b8b02

Please sign in to comment.