Skip to content

Commit

Permalink
Init commit with hello world shit
Browse files Browse the repository at this point in the history
  • Loading branch information
phenax committed Dec 13, 2024
0 parents commit 7553b33
Show file tree
Hide file tree
Showing 12 changed files with 262 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
use flake

watch_file *.cabal
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
result
dist-newstyle/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Chelleport

WIP

8 changes: 8 additions & 0 deletions TODO.norg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* Current
- ( )

* Later
- ( )

* Maybe
- ( )
12 changes: 12 additions & 0 deletions bin/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Main where

import qualified Chelleport
import Data.Text (Text, splitOn)
import qualified Data.Text as Text
import System.Environment (getArgs)
import System.Exit (exitFailure)

main :: IO ()
main = do
putStrLn "Wow"
Chelleport.open
61 changes: 61 additions & 0 deletions chelleport.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
cabal-version: 3.0

name: chelleport
version: 0.1.0.0
license: MIT
author: Akshay Nair <[email protected]>
maintainer: Akshay Nair <[email protected]>
build-type: Simple
synopsis: Mouse control
description: Mouse control

common common-config
default-extensions:
OverloadedStrings,
LambdaCase,
QuasiQuotes,
TemplateHaskell,
TupleSections,
NamedFieldPuns
default-language: Haskell2010
build-depends:
base,
text,
containers

common warnings
ghc-options:
-Wall -Wincomplete-record-updates -Wincomplete-uni-patterns
-Wunused-foralls -Wextra -Wno-unused-do-bind -Wname-shadowing
-fwarn-tabs -fprint-explicit-foralls -fprint-explicit-kinds

executable chelleport
import: common-config, warnings
hs-source-dirs: bin
main-is: Main.hs
build-depends: lib-chelleport
-- other-modules:

library lib-chelleport
import: common-config, warnings
hs-source-dirs: src
build-depends:
gloss == 1.13.2.2,
sdl2 == 2.5.5.0
exposed-modules:
Chelleport

test-suite specs
import: common-config
type: exitcode-stdio-1.0
hs-source-dirs: specs
main-is: Main.hs
other-modules:
Specs.ParserSpec,
Specs.SerializerSpec,
Specs.TransformerSpec
build-depends:
lib-chelleport,
neat-interpolation,
pretty-simple,
hspec
74 changes: 74 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [ inputs.haskell-flake.flakeModule ];

perSystem = { self', pkgs, lib, config, ... }: {
haskellProjects.default = {
projectRoot = builtins.toString (lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./src
./specs
./chelleport.cabal
];
});

packages = {};
settings = {};

devShell = {
# tools = hp: { fourmolu = hp.fourmolu; ghcid = null; };
hlsCheck.enable = pkgs.stdenv.isDarwin;
};

autoWire = [ "packages" "apps" "checks" ];
};

packages.default = self'.packages.chelleport;
apps.default = self'.apps.chelleport;

devShells.default = pkgs.mkShell {
inputsFrom = [
config.haskellProjects.default.outputs.devShell
];
packages = with pkgs; [
just
haskellPackages.hspec-golden
];
};
};
};
}
10 changes: 10 additions & 0 deletions hie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cradle:
cabal:
- path: "./src"
component: "lib:lib-chelleport"

- path: "./bin/Main.hs"
component: "exe:chelleport"

- path: "./specs"
component: "test:specs"
14 changes: 14 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
default:
@just --choose

run *args:
cabal run chelleport -- {{args}}

test:
cabal test

testw:
npx nodemon -e .hs -w src --exec 'ghcid -c "cabal repl test:specs" -T :main'

build:
nix build
8 changes: 8 additions & 0 deletions specs/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Main (main) where

import qualified Specs.ParserSpec
import Test.Hspec (hspec)

main :: IO ()
main = hspec $ do
Specs.ParserSpec.test
18 changes: 18 additions & 0 deletions src/Chelleport.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Chelleport where

import Graphics.Gloss

open =
display
( InWindow
"Hello World" -- window title
(400, 150) -- window size
(10, 10) -- window position
)
white -- background color
picture -- picture to display

picture =
Translate (-170) (-20) $ -- shift the text to the middle of the window
Scale 0.5 0.5 $ -- display it half the original size
Text "Hello World" -- text to display

0 comments on commit 7553b33

Please sign in to comment.