Skip to content

Commit

Permalink
"improve" things
Browse files Browse the repository at this point in the history
  • Loading branch information
bristermitten committed Nov 7, 2023
1 parent 19054e9 commit 0bfc230
Show file tree
Hide file tree
Showing 27 changed files with 3,298 additions and 196 deletions.
6 changes: 3 additions & 3 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ import Print
import System.CPUTime
import System.Directory (createDirectoryIfMissing)
import System.Environment (getEnvironment)
import System.FilePath
import System.IO (openFile)
import System.Process
import Text.Printf
import System.FilePath

outDirName :: IsString s => s
outDirName = "build"
Expand Down Expand Up @@ -130,9 +130,9 @@ runElara dumpShunted dumpTyped dumpCore run = fmap fst <$> finalisePipeline $ do

createAndWriteFile :: FilePath -> LByteString -> IO ()
createAndWriteFile path content = do
createDirectoryIfMissing True $ takeDirectory path
createDirectoryIfMissing True $ takeDirectory path

writeFileLBS path content
writeFileLBS path content

cleanup :: IO ()
cleanup = resetGlobalUniqueSupply
Expand Down
8 changes: 4 additions & 4 deletions build/Elara.Prim.core.elr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Elara.Prim
{ Elara.Prim.cons : forall (a_1 : Type). a_1 -> [] a_1 -> [] a_1
= Elara.Prim.elaraPrimitive @(a_1 -> [] a_1 -> [] a_1) "cons"
{ Elara.Prim.cons : forall (a_1 : Type). a_1 -> [a_1] -> [a_1]
= Elara.Prim.elaraPrimitive @(a_1 -> [a_1] -> [a_1]) "cons"
;
Elara.Prim.empty : forall (a_2 : Type). [] a_2
= Elara.Prim.elaraPrimitive @([] a_2) "empty"
Elara.Prim.empty : forall (a_2 : Type). [a_2]
= Elara.Prim.elaraPrimitive @([a_2]) "empty"
;
Elara.Prim.println : String -> IO ()
= Elara.Prim.elaraPrimitive @(String -> IO ()) "println"
Expand Down
Binary file modified build/Elara/Prim.class
Binary file not shown.
5 changes: 3 additions & 2 deletions build/Main.core.elr
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Main
{ Main.fact : Int -> Int
= \ (n_5 : Int) -> case (Elara.Prim.== @Int n_5 0) { Elara.Prim.True -> 1; Elara.Prim.False -> Elara.Prim.* n_5 (Main.fact (Elara.Prim.- n_5 1))}
= \ (n_5 : Int) -> case Elara.Prim.== @Int n_5 0
{ Elara.Prim.True : Bool -> 1; Elara.Prim.False : Bool -> Elara.Prim.* n_5 (Main.fact (Elara.Prim.- n_5 1))}
;
Main.main : IO ()
= Elara.Prim.println (Elara.Prim.toString @([] Int) (Prelude.++ (Elara.Prim.cons 1 Elara.Prim.empty) (Elara.Prim.cons 2 Elara.Prim.empty))) }
= Elara.Prim.println (Elara.Prim.toString @([Int]) (Prelude.++ (Elara.Prim.cons 1 Elara.Prim.empty) (Elara.Prim.cons 2 Elara.Prim.empty))) }
20 changes: 10 additions & 10 deletions build/Main.typed.elr
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ let Main.main =
IO Unit
((Elara.Prim.toString : forall (a_3 : Type) .
a_3 -> Text @List
Integer) : Text ((Prelude.(++) : forall (a_10 : Type) .
Integer) : Text ((Prelude.(++) : forall (a_6 : Type) .
List
a_10 ->
a_6 ->
List
a_10 ->
a_6 ->
List
a_10 [ 1 : Integer ] : List
Integer) : List
Integer ->
List
Integer [ 2 : Integer ] : List
Integer) : List
Integer) : Text) : IO Unit
a_6 [ 1 : Integer ] : List
Integer) : List
Integer ->
List
Integer [ 2 : Integer ] : List
Integer) : List
Integer) : Text) : IO Unit

Binary file modified build/Prelude.class
Binary file not shown.
8 changes: 3 additions & 5 deletions build/Prelude.core.elr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module Prelude
{ Prelude.++ : forall (a_10 : Type). [] a_10 -> [] a_10 -> [] a_10
= \ (a_11 : [] a_10) (b_12 : [] a_10) -> case a_11 of (a_64 : forall (a_10 : Type). [] a_10) { Elara.Prim.empty -> b_12; Elara.Prim.cons -> Elara.Prim.cons @a_10 x_13 (Prelude.++ xs_14 b_12)}
;
Prelude.reverse : forall (a_6 : Type). [] a_6 -> [] a_6
= \ (x_7 : [] a_6) -> case x_7 of (x_65 : forall (a_6 : Type). [] a_6) { Elara.Prim.empty -> Elara.Prim.empty; Elara.Prim.cons -> Prelude.++ (Prelude.reverse xs_9) (Elara.Prim.cons x_8 Elara.Prim.empty)} }
{ Prelude.++ : forall (a_6 : Type). [a_6] -> [a_6] -> [a_6]
= \ (a_7 : [a_6]) (b_8 : [a_6]) -> case a_7 of (a_58 : forall (a_6 : Type). [a_6])
{ Elara.Prim.empty : [([a_6])] -> b_8; Elara.Prim.cons : [] (x_9 : a_6) (xs_10 : [a_6]) -> Elara.Prim.cons @a_6 x_9 (Prelude.++ xs_10 b_8)} }
Loading

0 comments on commit 0bfc230

Please sign in to comment.