Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Efficient storage of sum data types #522

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
26798bd
link posable library
Riscky Feb 23, 2022
d46f7c7
POS instances for primary types, Vec
Riscky Feb 24, 2022
078d4f0
emptyFields implementation for Vec
Riscky Feb 24, 2022
a327abe
Redefine Elt for Shapes
Riscky Feb 24, 2022
7d24117
actually fill array in replicateVecN
Riscky Feb 24, 2022
df2ecff
Array with Elt'
Riscky Feb 25, 2022
99f482b
don't import Type from POS
Riscky Mar 1, 2022
8476596
convert typelists to tuples
Riscky Mar 1, 2022
d994fdd
Convert POS to EltR
Riscky Mar 2, 2022
27eac67
integrate Elt and POS?
Riscky Mar 2, 2022
3080b14
sorta kinda integrated POS into shapes
Riscky Mar 2, 2022
b878ec6
Slices understand SingletonTypes now
Riscky Mar 3, 2022
a1e1497
shapes with singletontypes
Riscky Mar 3, 2022
1e4a1f5
shape sugar with singletontypes
Riscky Mar 3, 2022
c66b0f7
more array with singletontypes
Riscky Mar 3, 2022
88401e1
reverted elt' change
Riscky Mar 3, 2022
fdca1a2
AST understands POS
Riscky Mar 4, 2022
bce5173
AST understands POS
Riscky Mar 8, 2022
238551f
stencil
Riscky Mar 8, 2022
05b4ade
Make Singletontypes behave as original
Riscky Mar 8, 2022
f714a7d
revert shape, slice singletons
Riscky Mar 8, 2022
ae5f19f
revert sugar shape singleton
Riscky Mar 8, 2022
fd1398f
revert stencil singletontype
Riscky Mar 8, 2022
996ad1b
revert singletontype completely
Riscky Mar 8, 2022
e1e00f7
create groundtypes with POSable instance via TH
Riscky Mar 10, 2022
520adc6
default definition for eltR, including ugly hacks
Riscky Mar 11, 2022
df1fd12
add OuterChoices / outerChoice to POS instances
Riscky Mar 29, 2022
c299d35
remove unused stuff from Representation/POS
Riscky Mar 29, 2022
fac73b7
convert Sums to tuple representation
Riscky Apr 7, 2022
b8d1fa0
pretty print POS structures
Riscky Apr 7, 2022
ead51a2
IsScalar instances for SumScalarType
Riscky Apr 7, 2022
8f825d3
build Maybe in Matchable
Riscky Apr 7, 2022
e13bed1
compiling Maybe Int pattern match
Riscky Apr 7, 2022
09447f7
build TAG
Riscky Apr 8, 2022
6bce206
split EltR with helper function
Riscky Apr 12, 2022
a353044
simplify SumScalarType
Riscky Apr 12, 2022
3314491
more stuff for Matchable
Riscky Apr 12, 2022
0f6cf5b
simpler union operators
Riscky Apr 14, 2022
26b41c8
new union ast constructors
Riscky May 17, 2022
5caac30
only allow singleTypes in sums
Riscky May 17, 2022
2b9a753
rename sumscalar to unionscalar
Riscky May 17, 2022
79fed72
rewrote Matchable without POSable references
Riscky May 19, 2022
da6380e
index operator with beauty notation
Riscky May 20, 2022
02bf6cb
removed outerchoices
Riscky May 20, 2022
5d05a98
more Either build AST
Riscky May 20, 2022
912b66c
cleanup Matchable
Riscky Jun 1, 2022
b17614c
makeLeft works :O
Riscky Jun 1, 2022
25bbffb
more Maybe build
Riscky Jun 2, 2022
7a52b2c
build implemented for Maybe a
Riscky Jun 2, 2022
e183544
match on maybe
Riscky Jun 2, 2022
7f1a7bc
Matchable instance for polymorphic Either
Riscky Jun 2, 2022
15716b7
tag building in terms of tagVal
Riscky Jun 2, 2022
24d2458
pattern matching up to pattern synonyms
Riscky Jun 3, 2022
28fc675
Patterns for Maybe
Riscky Jun 3, 2022
a9b4d34
pattern synonyms for Either and Bool
Riscky Jun 3, 2022
908f47a
make integer synonyms Ground and POSable
Riscky Jun 3, 2022
ff615b9
correct definition of mkEltR and fromEltR
Riscky Jun 22, 2022
6fe8dd3
define mkEltRT in terms of eltRType
Riscky Jun 23, 2022
1930f77
simplify scalarTypeTAGg
Riscky Jun 23, 2022
f845bd2
replace mkMin by correct mkSub
Riscky Jun 23, 2022
781ac2d
use type lists for unionscalars
Riscky Jun 24, 2022
dc522ea
use posable from hackage
Riscky Jun 30, 2022
a338b9f
update version ranges to match posable
Riscky Jun 30, 2022
52a8621
remove unused PrimShiftFinite operator
Riscky Jun 30, 2022
b974e62
revert unchanged file
Riscky Jun 30, 2022
12fa79a
bit of cleanup
Riscky Jun 30, 2022
e2dcdac
remove unused imports
Riscky Jun 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
don't import Type from POS
  • Loading branch information
Riscky committed Jun 30, 2022
commit 99f482b56d199c6d31d10f75f804e32d7ea19f95
7 changes: 6 additions & 1 deletion src/Data/Array/Accelerate/Representation/POS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module Data.Array.Accelerate.Representation.POS (
GroundType, Finite, ProductType(..), SumType(..))
where

import Data.Array.Accelerate.Type
-- import Data.Array.Accelerate.Type

import Data.Bits
import Data.Char
Expand All @@ -45,6 +45,11 @@ import Data.Type.POSable.POSable
import Data.Type.POSable.Representation
import Data.Type.POSable.Instances

import Data.Int
import Data.Word
import Numeric.Half
import Foreign.C.Types

type POS a = (Finite (Choices a), Product (Fields a))

mkPOS :: (POSable a) => a -> POS a
Expand Down