haskell my beloved

This commit is contained in:
crumbtoo
2023-11-08 12:27:30 -07:00
parent 90cea92c13
commit 2504f91572
44 changed files with 510 additions and 129 deletions

2
.gitignore vendored
View File

@@ -1,2 +1,2 @@
./build/
./dist-newstyle

5
app/Main.hs Normal file
View File

@@ -0,0 +1,5 @@
module Main where
----------------------------------------------------------------------------------
main :: IO ()
main = putStrLn "god i love you haskell i love you ghc i love you functionalprogramming researchers"

View File

@@ -0,0 +1,74 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module Paths_rlp (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import qualified Data.List as List
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
#if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif
#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO = Exception.catch
version :: Version
version = Version [0,1,0,0] []
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir `joinFileName` name)
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/Users/crumble/.cabal/bin"
libdir = "/Users/crumble/.cabal/lib/x86_64-osx-ghc-9.6.2/rlp-0.1.0.0-inplace"
dynlibdir = "/Users/crumble/.cabal/lib/x86_64-osx-ghc-9.6.2"
datadir = "/Users/crumble/.cabal/share/x86_64-osx-ghc-9.6.2/rlp-0.1.0.0"
libexecdir = "/Users/crumble/.cabal/libexec/x86_64-osx-ghc-9.6.2/rlp-0.1.0.0"
sysconfdir = "/Users/crumble/.cabal/etc"
getBinDir = catchIO (getEnv "rlp_bindir") (\_ -> return bindir)
getLibDir = catchIO (getEnv "rlp_libdir") (\_ -> return libdir)
getDynLibDir = catchIO (getEnv "rlp_dynlibdir") (\_ -> return dynlibdir)
getDataDir = catchIO (getEnv "rlp_datadir") (\_ -> return datadir)
getLibexecDir = catchIO (getEnv "rlp_libexecdir") (\_ -> return libexecdir)
getSysconfDir = catchIO (getEnv "rlp_sysconfdir") (\_ -> return sysconfdir)
joinFileName :: String -> String -> FilePath
joinFileName "" fname = fname
joinFileName "." fname = fname
joinFileName dir "" = dir
joinFileName dir fname
| isPathSeparator (List.last dir) = dir ++ fname
| otherwise = dir ++ pathSeparator : fname
pathSeparator :: Char
pathSeparator = '/'
isPathSeparator :: Char -> Bool
isPathSeparator c = c == '/'

View File

@@ -0,0 +1,123 @@
/* DO NOT EDIT: This file is automatically generated by Cabal */
/* package rlp-0.1.0.0 */
#ifndef VERSION_rlp
#define VERSION_rlp "0.1.0.0"
#endif /* VERSION_rlp */
#ifndef MIN_VERSION_rlp
#define MIN_VERSION_rlp(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_rlp */
/* package base-4.18.0.0 */
#ifndef VERSION_base
#define VERSION_base "4.18.0.0"
#endif /* VERSION_base */
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(major1,major2,minor) (\
(major1) < 4 || \
(major1) == 4 && (major2) < 18 || \
(major1) == 4 && (major2) == 18 && (minor) <= 0)
#endif /* MIN_VERSION_base */
/* tool gcc-14.0.0 */
#ifndef TOOL_VERSION_gcc
#define TOOL_VERSION_gcc "14.0.0"
#endif /* TOOL_VERSION_gcc */
#ifndef MIN_TOOL_VERSION_gcc
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\
(major1) < 14 || \
(major1) == 14 && (major2) < 0 || \
(major1) == 14 && (major2) == 0 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_gcc */
/* tool ghc-9.6.2 */
#ifndef TOOL_VERSION_ghc
#define TOOL_VERSION_ghc "9.6.2"
#endif /* TOOL_VERSION_ghc */
#ifndef MIN_TOOL_VERSION_ghc
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_ghc */
/* tool ghc-pkg-9.6.2 */
#ifndef TOOL_VERSION_ghc_pkg
#define TOOL_VERSION_ghc_pkg "9.6.2"
#endif /* TOOL_VERSION_ghc_pkg */
#ifndef MIN_TOOL_VERSION_ghc_pkg
#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_ghc_pkg */
/* tool haddock-2.28.0 */
#ifndef TOOL_VERSION_haddock
#define TOOL_VERSION_haddock "2.28.0"
#endif /* TOOL_VERSION_haddock */
#ifndef MIN_TOOL_VERSION_haddock
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 28 || \
(major1) == 2 && (major2) == 28 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_haddock */
/* tool happy-1.20.1.1 */
#ifndef TOOL_VERSION_happy
#define TOOL_VERSION_happy "1.20.1.1"
#endif /* TOOL_VERSION_happy */
#ifndef MIN_TOOL_VERSION_happy
#define MIN_TOOL_VERSION_happy(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 20 || \
(major1) == 1 && (major2) == 20 && (minor) <= 1)
#endif /* MIN_TOOL_VERSION_happy */
/* tool hpc-0.68 */
#ifndef TOOL_VERSION_hpc
#define TOOL_VERSION_hpc "0.68"
#endif /* TOOL_VERSION_hpc */
#ifndef MIN_TOOL_VERSION_hpc
#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hpc */
/* tool hsc2hs-0.68.9 */
#ifndef TOOL_VERSION_hsc2hs
#define TOOL_VERSION_hsc2hs "0.68.9"
#endif /* TOOL_VERSION_hsc2hs */
#ifndef MIN_TOOL_VERSION_hsc2hs
#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 9)
#endif /* MIN_TOOL_VERSION_hsc2hs */
/* tool pkg-config-0.29.2 */
#ifndef TOOL_VERSION_pkg_config
#define TOOL_VERSION_pkg_config "0.29.2"
#endif /* TOOL_VERSION_pkg_config */
#ifndef MIN_TOOL_VERSION_pkg_config
#define MIN_TOOL_VERSION_pkg_config(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 29 || \
(major1) == 0 && (major2) == 29 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_pkg_config */
/* tool runghc-9.6.2 */
#ifndef TOOL_VERSION_runghc
#define TOOL_VERSION_runghc "9.6.2"
#endif /* TOOL_VERSION_runghc */
#ifndef MIN_TOOL_VERSION_runghc
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_runghc */
#ifndef CURRENT_PACKAGE_KEY
#define CURRENT_PACKAGE_KEY "rlp-0.1.0.0-inplace"
#endif /* CURRENT_packageKey */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "rlp-0.1.0.0-inplace"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1.0.0"
#endif /* CURRENT_PACKAGE_VERSION */

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,74 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module Paths_rlp (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import qualified Data.List as List
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
#if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif
#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO = Exception.catch
version :: Version
version = Version [0,1,0,0] []
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir `joinFileName` name)
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/Users/crumble/.cabal/bin"
libdir = "/Users/crumble/.cabal/lib/x86_64-osx-ghc-9.6.2/rlp-0.1.0.0-inplace-rlpc"
dynlibdir = "/Users/crumble/.cabal/lib/x86_64-osx-ghc-9.6.2"
datadir = "/Users/crumble/.cabal/share/x86_64-osx-ghc-9.6.2/rlp-0.1.0.0"
libexecdir = "/Users/crumble/.cabal/libexec/x86_64-osx-ghc-9.6.2/rlp-0.1.0.0"
sysconfdir = "/Users/crumble/.cabal/etc"
getBinDir = catchIO (getEnv "rlp_bindir") (\_ -> return bindir)
getLibDir = catchIO (getEnv "rlp_libdir") (\_ -> return libdir)
getDynLibDir = catchIO (getEnv "rlp_dynlibdir") (\_ -> return dynlibdir)
getDataDir = catchIO (getEnv "rlp_datadir") (\_ -> return datadir)
getLibexecDir = catchIO (getEnv "rlp_libexecdir") (\_ -> return libexecdir)
getSysconfDir = catchIO (getEnv "rlp_sysconfdir") (\_ -> return sysconfdir)
joinFileName :: String -> String -> FilePath
joinFileName "" fname = fname
joinFileName "." fname = fname
joinFileName dir "" = dir
joinFileName dir fname
| isPathSeparator (List.last dir) = dir ++ fname
| otherwise = dir ++ pathSeparator : fname
pathSeparator :: Char
pathSeparator = '/'
isPathSeparator :: Char -> Bool
isPathSeparator c = c == '/'

View File

@@ -0,0 +1,130 @@
/* DO NOT EDIT: This file is automatically generated by Cabal */
/* package rlp-0.1.0.0 */
#ifndef VERSION_rlp
#define VERSION_rlp "0.1.0.0"
#endif /* VERSION_rlp */
#ifndef MIN_VERSION_rlp
#define MIN_VERSION_rlp(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_rlp */
/* package base-4.18.0.0 */
#ifndef VERSION_base
#define VERSION_base "4.18.0.0"
#endif /* VERSION_base */
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(major1,major2,minor) (\
(major1) < 4 || \
(major1) == 4 && (major2) < 18 || \
(major1) == 4 && (major2) == 18 && (minor) <= 0)
#endif /* MIN_VERSION_base */
/* package rlp-0.1.0.0 */
#ifndef VERSION_rlp
#define VERSION_rlp "0.1.0.0"
#endif /* VERSION_rlp */
#ifndef MIN_VERSION_rlp
#define MIN_VERSION_rlp(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_rlp */
/* tool gcc-14.0.0 */
#ifndef TOOL_VERSION_gcc
#define TOOL_VERSION_gcc "14.0.0"
#endif /* TOOL_VERSION_gcc */
#ifndef MIN_TOOL_VERSION_gcc
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\
(major1) < 14 || \
(major1) == 14 && (major2) < 0 || \
(major1) == 14 && (major2) == 0 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_gcc */
/* tool ghc-9.6.2 */
#ifndef TOOL_VERSION_ghc
#define TOOL_VERSION_ghc "9.6.2"
#endif /* TOOL_VERSION_ghc */
#ifndef MIN_TOOL_VERSION_ghc
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_ghc */
/* tool ghc-pkg-9.6.2 */
#ifndef TOOL_VERSION_ghc_pkg
#define TOOL_VERSION_ghc_pkg "9.6.2"
#endif /* TOOL_VERSION_ghc_pkg */
#ifndef MIN_TOOL_VERSION_ghc_pkg
#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_ghc_pkg */
/* tool haddock-2.28.0 */
#ifndef TOOL_VERSION_haddock
#define TOOL_VERSION_haddock "2.28.0"
#endif /* TOOL_VERSION_haddock */
#ifndef MIN_TOOL_VERSION_haddock
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 28 || \
(major1) == 2 && (major2) == 28 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_haddock */
/* tool happy-1.20.1.1 */
#ifndef TOOL_VERSION_happy
#define TOOL_VERSION_happy "1.20.1.1"
#endif /* TOOL_VERSION_happy */
#ifndef MIN_TOOL_VERSION_happy
#define MIN_TOOL_VERSION_happy(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 20 || \
(major1) == 1 && (major2) == 20 && (minor) <= 1)
#endif /* MIN_TOOL_VERSION_happy */
/* tool hpc-0.68 */
#ifndef TOOL_VERSION_hpc
#define TOOL_VERSION_hpc "0.68"
#endif /* TOOL_VERSION_hpc */
#ifndef MIN_TOOL_VERSION_hpc
#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hpc */
/* tool hsc2hs-0.68.9 */
#ifndef TOOL_VERSION_hsc2hs
#define TOOL_VERSION_hsc2hs "0.68.9"
#endif /* TOOL_VERSION_hsc2hs */
#ifndef MIN_TOOL_VERSION_hsc2hs
#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 9)
#endif /* MIN_TOOL_VERSION_hsc2hs */
/* tool pkg-config-0.29.2 */
#ifndef TOOL_VERSION_pkg_config
#define TOOL_VERSION_pkg_config "0.29.2"
#endif /* TOOL_VERSION_pkg_config */
#ifndef MIN_TOOL_VERSION_pkg_config
#define MIN_TOOL_VERSION_pkg_config(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 29 || \
(major1) == 0 && (major2) == 29 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_pkg_config */
/* tool runghc-9.6.2 */
#ifndef TOOL_VERSION_runghc
#define TOOL_VERSION_runghc "9.6.2"
#endif /* TOOL_VERSION_runghc */
#ifndef MIN_TOOL_VERSION_runghc
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_runghc */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "rlp-0.1.0.0-inplace-rlpc"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1.0.0"
#endif /* CURRENT_PACKAGE_VERSION */

BIN
dist-newstyle/cache/compiler vendored Normal file

Binary file not shown.

BIN
dist-newstyle/cache/config vendored Normal file

Binary file not shown.

BIN
dist-newstyle/cache/elaborated-plan vendored Normal file

Binary file not shown.

BIN
dist-newstyle/cache/improved-plan vendored Normal file

Binary file not shown.

1
dist-newstyle/cache/plan.json vendored Normal file
View File

@@ -0,0 +1 @@
{"cabal-version":"3.8.1.0","cabal-lib-version":"3.8.1.0","compiler-id":"ghc-9.6.2","os":"osx","arch":"x86_64","install-plan":[{"type":"pre-existing","id":"base-4.18.0.0","pkg-name":"base","pkg-version":"4.18.0.0","depends":["ghc-bignum-1.3","ghc-prim-0.10.0","rts-1.0.2"]},{"type":"pre-existing","id":"ghc-bignum-1.3","pkg-name":"ghc-bignum","pkg-version":"1.3","depends":["ghc-prim-0.10.0"]},{"type":"pre-existing","id":"ghc-prim-0.10.0","pkg-name":"ghc-prim","pkg-version":"0.10.0","depends":["rts-1.0.2"]},{"type":"configured","id":"rlp-0.1.0.0-inplace","pkg-name":"rlp","pkg-version":"0.1.0.0","flags":{},"style":"local","pkg-src":{"type":"local","path":"/Users/crumble/Documents/school/CSA/rlp/."},"dist-dir":"/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0","build-info":"/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/build-info.json","depends":["base-4.18.0.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"rlp-0.1.0.0-inplace-rlp-test","pkg-name":"rlp","pkg-version":"0.1.0.0","flags":{},"style":"local","pkg-src":{"type":"local","path":"/Users/crumble/Documents/school/CSA/rlp/."},"dist-dir":"/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/t/rlp-test","build-info":"/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/t/rlp-test/build-info.json","depends":["base-4.18.0.0","rlp-0.1.0.0-inplace"],"exe-depends":[],"component-name":"test:rlp-test","bin-file":"/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/t/rlp-test/build/rlp-test/rlp-test"},{"type":"configured","id":"rlp-0.1.0.0-inplace-rlpc","pkg-name":"rlp","pkg-version":"0.1.0.0","flags":{},"style":"local","pkg-src":{"type":"local","path":"/Users/crumble/Documents/school/CSA/rlp/."},"dist-dir":"/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/x/rlpc","build-info":"/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/x/rlpc/build-info.json","depends":["base-4.18.0.0","rlp-0.1.0.0-inplace"],"exe-depends":[],"component-name":"exe:rlpc","bin-file":"/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/x/rlpc/build/rlpc/rlpc"},{"type":"pre-existing","id":"rts-1.0.2","pkg-name":"rts","pkg-version":"1.0.2","depends":[]}]}

BIN
dist-newstyle/cache/solver-plan vendored Normal file

Binary file not shown.

BIN
dist-newstyle/cache/source-hashes vendored Normal file

Binary file not shown.

BIN
dist-newstyle/cache/up-to-date vendored Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,32 @@
name: rlp
version: 0.1.0.0
visibility: public
id: rlp-0.1.0.0-inplace
key: rlp-0.1.0.0-inplace
license: GPL-2.0-only
maintainer: crumb@disroot.org
author: crumbtoo
category: Language
abi: inplace
exposed: True
exposed-modules: Core
import-dirs:
/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/build
library-dirs:
/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/build
library-dirs-static:
/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/build
dynamic-library-dirs:
/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/build
data-dir: /Users/crumble/Documents/school/CSA/rlp/.
hs-libraries: HSrlp-0.1.0.0-inplace
depends: base-4.18.0.0
haddock-interfaces:
/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/doc/html/rlp/rlp.haddock
haddock-html:
/Users/crumble/Documents/school/CSA/rlp/dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/doc/html/rlp

View File

@@ -1,14 +0,0 @@
project(
'rlp',
'java',
version: '0.0.0-dev',
license: 'GPL-3.0'
)
rlpc_jar = jar(
'rlpc',
'rlp/RLPC.java',
'rlp/Core.java',
main_class: 'rlp.rlpc.RLPC'
)

51
rlp.cabal Normal file
View File

@@ -0,0 +1,51 @@
cabal-version: 3.0
name: rlp
version: 0.1.0.0
-- synopsis:
-- description:
license: GPL-2.0-only
-- license-file: LICENSE
author: crumbtoo
maintainer: crumb@disroot.org
-- copyright:
category: Language
build-type: Simple
extra-doc-files: README.md
-- extra-source-files:
common warnings
ghc-options: -Wall
library
import: warnings
exposed-modules: Core
-- other-modules:
-- other-extensions:
build-depends: base ^>=4.18.0.0
hs-source-dirs: src
default-language: GHC2021
executable rlpc
import: warnings
main-is: Main.hs
-- other-modules:
-- other-extensions:
build-depends:
base ^>=4.18.0.0,
rlp
hs-source-dirs: app
default-language: GHC2021
test-suite rlp-test
import: warnings
default-language: GHC2021
-- other-modules:
-- other-extensions:
type: exitcode-stdio-1.0
hs-source-dirs: tst
main-is: Main.hs
build-depends:
base ^>=4.18.0.0,
rlp

View File

@@ -1,92 +0,0 @@
package rlp;
/*------------------------------------------------------------------------------*/
public class Core
{
/* day 1: boy do i miss Haskell */
public sealed interface Expr permits App, TyApp, Abs, TyAbs, Var {}
public record App(Expr f, Expr x) implements Expr {}
public record TyApp(Expr f, Ty x) implements Expr {}
public record Abs(Name n, Ty t, Expr m) implements Expr {}
public record TyAbs(Name n, Expr m) implements Expr {}
public record Var(Name n) implements Expr {}
sealed interface Ty permits VarTy, Forall, FuncTy, AppTy {}
public record VarTy(Name n) implements Ty {}
public record Forall(Name n, Ty m) implements Ty {}
public record FuncTy(Ty a, Ty b) implements Ty {}
public record AppTy(Ty f, Ty x) implements Ty {}
public final static class Name
{
public final String s;
public Name(String s)
{
// TODO: verify that `s` is a valid identifier
this.s = s;
}
}
public static String showExpr(Expr e)
{
return showExprP(0, e);
}
static String showExprP(int p, Expr e)
{
return switch(e)
{
/* prec: 1 */
case App a ->
wrap(p, 1, showExprP(2, a.f) + " " + showExprP(2, a.x));
/* prec: 1 */
case TyApp a ->
wrap(p, 1, showExprP(2, a.f) + " " + showTyP(2, a.x));
/* prec: 0 */
case Abs a ->
wrap(p, 0, String.format
( "λ(%s:%s).%s"
, a.n.s
, showTyP(0, a.t)
, showExprP(0, a.m)));
/* prec: 0 */
case TyAbs a ->
wrap(p, 0, String.format
( "Λ%s.%s"
, a.n.s
, showExprP(0, a.m)));
case Var a ->
a.n.s;
};
}
static String showTy(Ty t)
{
return showTyP(0, t);
}
static String showTyP(int p, Ty t)
{
return switch(t)
{
case VarTy a ->
a.n.s;
case Forall a ->
wrap(p, 0, "" + a.n.s + "." + showTyP(0, a.m));
case FuncTy a ->
"";
case AppTy a ->
showTyP(2, a.f) + " " + showTyP(2, a.x);
};
}
static String wrap(int p, int n, String s)
{
return (p <= n) ? s : "(" + s + ")";
}
}

View File

@@ -1,22 +0,0 @@
package rlp.rlpc;
/*----------------------------------------------------------------------------*/
import rlp.Core;
/*----------------------------------------------------------------------------*/
class RLPC
{
public static void main(String[] argv)
{
// final Core.Expr e = new Core.App(new Core.Var(new Core.Name("f")), new Core.Var(new Core.Name("x")));
final Core.Expr e =
new Core.App
( new Core.Abs
( new Core.Name("x")
, new Core.VarTy(new Core.Name("α"))
, new Core.Var(new Core.Name("x"))
)
, new Core.Var(new Core.Name("y")));
System.out.println(Core.showExpr(e));
}
}

14
src/Core.hs Normal file
View File

@@ -0,0 +1,14 @@
module Core where
----------------------------------------------------------------------------------
data Expr = Let Rec [Binding] Expr
| Case Expr [Alt]
data Binding
data Rec
data Alt
type Name = String

5
tst/Main.hs Normal file
View File

@@ -0,0 +1,5 @@
module Main (main) where
----------------------------------------------------------------------------------
main :: IO ()
main = putStrLn "Test suite not yet implemented."