Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

thautwarm/reley

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

See examples at haskell_test/*.hs. Currently you can install reley compiler with python setup.py install.

Usage

  • Compile:
> reley cc <filename>.hs -o <out>.pyc
> python <out>.pyc
  • Run Reley
> reley run <filename>.hs
  • Import reley programs in Python

If you have a reley source file haskell_test/sum_n.hs:

module
    m_sum, (==) -- export `m_sum` and  `(==)`
where

import operator (add, eq)
import functools (reduce)
import toolz (curry)
import reley.prelude ((+))

infix 5 (==)
infix 0 ($)
(==) = curry eq
($) a b = a b
(+) = curry add


m_sum lst = if lst == [] then 0
            else destruct lst
            where
                destruct (a, b) = a + m_sum(b)

main () =
    print $ m_sum [1, 2, 3, 4, 5, 6]

Then you can import it in Python

import reley.impl.pycompat

from haskell_test.sum_n import m_sum
lst = (5, (2, (1, ())))
print(m_sum(lst))

About Reley

It's in an early stage with many shortages. Most of the crucial Haskell features are missing.

About

haskell-like compiled language based on Python VM

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.