This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE OverloadedLabels #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE ImportQualifiedPost #-} | |
| module Main (main) where | |
| import Chart | |
| import Data.Text (Text) | |
| import Prelude as P |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module DataFrame where | |
| -- Column space with a closed type universe. | |
| data Column = CInt [Int] | |
| | CDouble [Double] | |
| | CString [String] | |
| instance Show Column where | |
| show (CInt xs) = show xs | |
| show (CDouble xs) = show xs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| correlation :: T.Text -> T.Text -> DataFrame -> Maybe Double | |
| correlation first second df = do | |
| (UnboxedColumn (f :: VU.Vector a)) <- getColumn first df | |
| (UnboxedColumn (s :: VU.Vector b)) <- getColumn second df | |
| Refl <- testEquality (typeRep @a) (typeRep @Double) | |
| Refl <- testEquality (typeRep @b) (typeRep @Double) | |
| let n = VG.length f | |
| let | |
| go (-1) acc = acc | |
| go i (mX :: Double, mY :: Double) = go (i - 1) (mX + f VU.! i, mY + s VU.! i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Day3 where | |
| import Data.List ( isPrefixOf ) | |
| import Data.List.Split ( splitOn ) | |
| import Data.Char ( isDigit ) | |
| run :: IO () | |
| run = do | |
| instructions <- readFile "./data/day3/input" | |
| let tuples = parseInstructions instructions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE GADTs #-} | |
| module Main where | |
| import Data.Map (Map) | |
| import Data.Type.Equality | |
| import Data.Typeable (Typeable) | |
| import Type.Reflection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Control.Monad | |
| import Data.Array | |
| -- A class for axis-aligned rectangles. | |
| -- The rectangle is defined by the left and right most x | |
| -- coordinates. And the left and rightmost y coordinates. | |
| type Point = (Int, Int) | |
| data Rectangle = Rectangle { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| project.afterEvaluate { | |
| extensions.compileFrege = { | |
| description = 'Compile Frege to Java' | |
| javaexec { | |
| android.dexOptions.setJavaMaxHeapSize("4g") | |
| android.defaultConfig.setMultiDexEnabled(true) | |
| def libs = project.rootDir.path + "/app/libs".replace('/' as char, File.separatorChar) | |
| def froid = new File(libs + "/froid.jar".replace('/' as char, File.separatorChar)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* | |
| -optimizationpasses 5 | |
| -allowaccessmodification | |
| -dontpreverify | |
| -dontusemixedcaseclassnames | |
| -dontskipnonpubliclibraryclasses | |
| -verbose | |
| -keepattributes *Annotation* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module io.github.mchav.simplecounter.CounterActivity where | |
| import froid.app.Activity | |
| import froid.os.Bundle | |
| import froid.view.View | |
| import froid.widget.Button | |
| import froid.widget.TextView | |
| native module type Activity where {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module io.github.mchav.touchcube.CubeActivity where | |
| import froid.javax.microedition.khronos.egl.EGLConfig | |
| import froid.javax.microedition.khronos.opengles.GL10 | |
| import froid.java.nio.ByteBuffer | |
| import froid.java.nio.IntBuffer | |
| import froid.app.Activity | |
| import froid.content.Context |