Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
/ hs-newlang Public archive

A dependently-typed language prototype inspired by edwinb's Idris2 & SPLV20

Notifications You must be signed in to change notification settings

DSLstandard/hs-newlang

Repository files navigation

Archive of a project I had worked on at around 2021 for several days in an attempt to create a language like idris2 with my own additions

***Highly*** inspired by https://github.com/idris-lang/Idris2 and https://github.com/edwinb/SPLV20

Info:

  • records & interfaces
  • implicit arguments
  • instance arguments, but i do not know how to properly implement instance resolution
  • Refl can be used for proving
  • user clauses -> Case Tree with an incorrect implementation of Jesper Cockx's
  • crude implementation of user-defined operators
  • Type : Type
  • working IO
  • MANY poor design choices were made
    • adding z to Term z for something related to interpreting IO and passing objects around, it did not go well

Example IO program:

guessingGame : IO Unit
guessingGame = do
  putl_str stdout "Guess the number"
  ans <- random_int 0 100
  repeat_while do
    put_str stdout "Guess it: "
    flush stdout
    r <- getl_str stdin
    // putl_str stdout (show r)
    case parse_int r of
      None => do
        putl_str stdout "Invalid input, please try again"
        pure True
      Some input => do
        case compare input ans of
          EQ => do
            putl_str stdout "Correct"
            pure False
          LT => do
            putl_str stdout "Too small"
            pure True
          GT => do
            putl_str stdout "Too big"
            pure True

About

A dependently-typed language prototype inspired by edwinb's Idris2 & SPLV20

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published