Exemple #1
0
def test_resolution1():

    example = """
    module Test1 {

        trait Foo[A t]:
            fun lt :: (A t, A t) -> (A bool)

        impl Foo[Array t]:
            fun lt = pass
    }

    """

    mod = mread(example)
    sig = mod.bound_ns["Array"]["lt"]
Exemple #2
0
def test_resolution2():

    example = """
    module Test1 {

        trait Foo[A t]:
            fun lt :: t , t -> t

        impl Foo[Array x]:
            fun lt = pass
    }

    """

    mod = mread(example)
    sig = mod.bound_ns["Array"]["lt"]
Exemple #3
0
def test_resolution1():

    example = \
    """
    module Test1 {

        trait Foo[A t]:
            fun lt :: (A t, A t) -> (A bool)

        impl Foo[Array t]:
            fun lt = pass
    }

    """

    mod = mread(example)
    sig = mod.bound_ns['Array']['lt']
Exemple #4
0
def test_resolution2():

    example = \
    """
    module Test1 {

        trait Foo[A t]:
            fun lt :: t , t -> t

        impl Foo[Array x]:
            fun lt = pass
    }

    """

    mod = mread(example)
    sig = mod.bound_ns['Array']['lt']
Exemple #5
0
def test_typeset():

    example = """
    module Test1 {

        typeset simple = int | float | bool

        trait Foo[A t]:
            fun lt :: t , t -> t

        impl Foo[Array x] for (x in simple):
            fun lt = pass
    }

    """

    mod = mread(example)
    sig = mod.bound_ns["Array"]["lt"]
Exemple #6
0
def test_typeset():

    example = \
    """
    module Test1 {

        typeset simple = int | float | bool

        trait Foo[A t]:
            fun lt :: t , t -> t

        impl Foo[Array x] for (x in simple):
            fun lt = pass
    }

    """

    mod = mread(example)
    sig = mod.bound_ns['Array']['lt']
Exemple #7
0
def test_arith():
    print mread(arith)
Exemple #8
0
def test_dummy():
    print mread(dummy)