Skip to content

Commit

Permalink
[ cabal ] for the ask project
Browse files Browse the repository at this point in the history
  • Loading branch information
gallais committed Sep 18, 2024
1 parent 96f3e8a commit 91ea693
Show file tree
Hide file tree
Showing 23 changed files with 258 additions and 113 deletions.
6 changes: 0 additions & 6 deletions Src/Main.hs

This file was deleted.

143 changes: 143 additions & 0 deletions ask.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
cabal-version: 3.0
-- The cabal-version field refers to the version of the .cabal specification,
-- and can be different from the cabal-install (the tool) version and the
-- Cabal (the library) version you are using. As such, the Cabal (the library)
-- version used must be equal or greater than the version stated in this field.
-- Starting from the specification version 2.2, the cabal-version field must be
-- the first thing in the cabal file.

-- Initial package description 'ask' generated by
-- 'cabal init'. For further documentation, see:
-- http://haskell.org/cabal/users-guide/
--
-- The name of the package.
name: ask

-- The package version.
-- See the Haskell package versioning policy (PVP) for standards
-- guiding when and how versions should be incremented.
-- https://pvp.haskell.org
-- PVP summary: +-+------- breaking API changes
-- | | +----- non-breaking API additions
-- | | | +--- code changes with no API change
version: 0.1.0.0

tested-with: GHC ==9.8.2 || ==9.6.4 || ==9.4.8 || ==9.2.8

-- A short (one-line) description of the package.
-- synopsis:

-- A longer description of the package.
-- description:

-- The license under which the package is released.
license: NONE

-- The package author(s).
author: Conor Mc Bride

-- An email address to which users can send suggestions, bug reports, and patches.
maintainer: [email protected]

-- A copyright notice.
-- copyright:
category: Language
build-type: Simple

-- Extra source files to be distributed with the package, such as examples, or a tutorial module.
-- extra-source-files:

common warnings
ghc-options: -Wall

library
-- Import common warning flags.
import: warnings

-- Modules exported by the library.
exposed-modules: Language.Ask.Bwd
, Language.Ask.ChkRaw
, Language.Ask.Context
, Language.Ask.Glueing
, Language.Ask.HalfZip
, Language.Ask.HardwiredRules
, Language.Ask.Hide
, Language.Ask.Lexing
, Language.Ask.OddEven
, Language.Ask.Parsing
, Language.Ask.Printing
, Language.Ask.Progging
, Language.Ask.Proving
, Language.Ask.RawAsk
, Language.Ask.Thin
, Language.Ask.Tm
, Language.Ask.Typing


-- Modules included in this library but not exported.
-- other-modules:

-- LANGUAGE extensions used by modules in this package.
-- other-extensions:

-- Other library packages from which modules are imported.
build-depends: base >=4.16 && <=4.21
, mtl >=2.2 && <2.4
, containers >= 0.6 && <0.7

-- Directories containing source files.
hs-source-dirs: lib

-- Base language which the package is written in.
default-language: Haskell2010

executable ask
-- Import common warning flags.
import: warnings

-- .hs or .lhs file containing the Main module.
main-is: Main.hs

-- Modules included in this executable, other than Main.
-- other-modules:

-- LANGUAGE extensions used by modules in this package.
-- other-extensions:

-- Other library packages from which modules are imported.
build-depends:
base ^>=4.19.1.0,
ask

-- Directories containing source files.
hs-source-dirs: src

-- Base language which the package is written in.
default-language: Haskell2010

test-suite ask-test
-- Import common warning flags.
import: warnings

-- Base language which the package is written in.
default-language: Haskell2010

-- Modules included in this executable, other than Main.
-- other-modules:

-- LANGUAGE extensions used by modules in this package.
-- other-extensions:

-- The interface type and version of the test suite.
type: exitcode-stdio-1.0

-- Directories containing source files.
hs-source-dirs: test

-- The entrypoint to the test suite.
main-is: Main.hs

-- Test dependencies.
build-depends:
base ^>=4.19.1.0,
ask
2 changes: 1 addition & 1 deletion Src/Bwd.hs → lib/Language/Ask/Bwd.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-# LANGUAGE DeriveTraversable #-}

module Ask.Src.Bwd where
module Language.Ask.Bwd where

infixl 3 :<, <><

Expand Down
30 changes: 15 additions & 15 deletions Src/ChkRaw.hs → lib/Language/Ask/ChkRaw.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-# LANGUAGE TupleSections, LambdaCase, PatternSynonyms #-}

module Ask.Src.ChkRaw where
module Language.Ask.ChkRaw where

import Data.List hiding ((\\))
import Data.Char
Expand All @@ -13,20 +13,20 @@ import Data.Foldable

import Debug.Trace

import Ask.Src.Hide
import Ask.Src.Thin
import Ask.Src.Bwd
import Ask.Src.OddEven
import Ask.Src.Lexing
import Ask.Src.RawAsk
import Ask.Src.Tm
import Ask.Src.Glueing
import Ask.Src.Context
import Ask.Src.Typing
import Ask.Src.Proving
import Ask.Src.Printing
import Ask.Src.HardwiredRules
import Ask.Src.Progging
import Language.Ask.Hide
import Language.Ask.Thin
import Language.Ask.Bwd
import Language.Ask.OddEven
import Language.Ask.Lexing
import Language.Ask.RawAsk
import Language.Ask.Tm
import Language.Ask.Glueing
import Language.Ask.Context
import Language.Ask.Typing
import Language.Ask.Proving
import Language.Ask.Printing
import Language.Ask.HardwiredRules
import Language.Ask.Progging

tracy = const id

Expand Down
16 changes: 7 additions & 9 deletions Src/Context.hs → lib/Language/Ask/Context.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
------------------------------------------------------------------------------
---------- ----------
---------- Ask.Src.Context ----------
---------- Context ----------
---------- ----------
------------------------------------------------------------------------------

Expand All @@ -11,19 +11,19 @@
, LambdaCase
#-}

module Ask.Src.Context where
module Language.Ask.Context where

import Control.Monad
import qualified Control.Monad.Fail as Fail
import qualified Data.Map as M
import Control.Applicative
import Control.Arrow ((***))

import Ask.Src.Bwd
import Ask.Src.Hide
import Ask.Src.Tm
import Ask.Src.Lexing
import Ask.Src.RawAsk
import Language.Ask.Bwd
import Language.Ask.Hide
import Language.Ask.Tm
import Language.Ask.Lexing
import Language.Ask.RawAsk


------------------------------------------------------------------------------
Expand Down Expand Up @@ -336,5 +336,3 @@ data Proglem = Proglem
, leftAppl :: [(Tm, Tm)] -- ditto for application arguments
, rightTy :: Tm -- return type
} deriving Show


6 changes: 3 additions & 3 deletions Src/Glueing.hs → lib/Language/Ask/Glueing.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Ask.Src.Glueing where
module Language.Ask.Glueing where

import Ask.Src.Tm
import Ask.Src.RawAsk
import Language.Ask.Tm
import Language.Ask.RawAsk

data TmR
= My Tm
Expand Down
2 changes: 1 addition & 1 deletion Src/HalfZip.hs → lib/Language/Ask/HalfZip.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Ask.Src.HalfZip where
module Language.Ask.HalfZip where

class HalfZippable f where
halfZipWith :: (x -> y -> Maybe z) -> f x -> f y -> Maybe (f z)
Expand Down
10 changes: 5 additions & 5 deletions Src/HardwiredRules.hs → lib/Language/Ask/HardwiredRules.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module Ask.Src.HardwiredRules where
module Language.Ask.HardwiredRules where

import qualified Data.Map as M

import Ask.Src.Bwd
import Ask.Src.Tm
import Ask.Src.RawAsk
import Ask.Src.Context
import Language.Ask.Bwd
import Language.Ask.Tm
import Language.Ask.RawAsk
import Language.Ask.Context

myFixities :: FixityTable
myFixities = M.fromList
Expand Down
2 changes: 1 addition & 1 deletion Src/Hide.hs → lib/Language/Ask/Hide.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Ask.Src.Hide where
module Language.Ask.Hide where

newtype Hide x = Hide {peek :: x}

Expand Down
6 changes: 3 additions & 3 deletions Src/Lexing.hs → lib/Language/Ask/Lexing.hs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{-# LANGUAGE EmptyDataDeriving, DeriveFunctor #-}

module Ask.Src.Lexing where
module Language.Ask.Lexing where

import Data.Char
import Data.List
import Data.Bifunctor

import Ask.Src.Bwd
import Ask.Src.OddEven
import Language.Ask.Bwd
import Language.Ask.OddEven

lexAll :: String -> Bloc Line
lexAll = lexPhase1 . lexPhase0
Expand Down
2 changes: 1 addition & 1 deletion Src/OddEven.hs → lib/Language/Ask/OddEven.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Ask.Src.OddEven where
module Language.Ask.OddEven where

import Data.Bifunctor
import Data.Bifoldable
Expand Down
6 changes: 3 additions & 3 deletions Src/Parsing.hs → lib/Language/Ask/Parsing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
, LambdaCase
#-}

module Ask.Src.Parsing where
module Language.Ask.Parsing where

import Control.Monad
import Control.Applicative
import Data.List

import Ask.Src.OddEven
import Ask.Src.Lexing
import Language.Ask.OddEven
import Language.Ask.Lexing

newtype ParTok e x = ParTok {parTok
:: e -- some sort of read-only environment, never mind what
Expand Down
18 changes: 9 additions & 9 deletions Src/Printing.hs → lib/Language/Ask/Printing.hs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{-# LANGUAGE LambdaCase #-}

module Ask.Src.Printing where
module Language.Ask.Printing where

import Data.Char
import Data.List

import Ask.Src.Hide
import Ask.Src.Bwd
import Ask.Src.Lexing
import Ask.Src.RawAsk
import Ask.Src.Tm
import Ask.Src.Glueing
import Ask.Src.Context
import Ask.Src.Typing
import Language.Ask.Hide
import Language.Ask.Bwd
import Language.Ask.Lexing
import Language.Ask.RawAsk
import Language.Ask.Tm
import Language.Ask.Glueing
import Language.Ask.Context
import Language.Ask.Typing

data Spot = AllOK | RadSpot | Infix (Int, Either Assocy Assocy) | Fun | Arg deriving (Show, Eq)
data Wot = Rad | Inf (Int, Assocy) | App deriving (Show, Eq)
Expand Down
Loading

0 comments on commit 91ea693

Please sign in to comment.