-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modernization updates and delayed cleanups
- Loading branch information
Showing
4 changed files
with
34 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
|
||
{-# LANGUAGE TypeOperators #-} | ||
{-# LANGUAGE GADTs #-} | ||
|
||
module Numerical.Array.Layout.Het where | ||
|
||
import Numerical.Array.Layout.Base | ||
import Numerical.Array.Layout.Base as LB | ||
import Data.Dynamic | ||
import Data.Sequence as Seq | ||
|
||
|
||
--- this operation is needed | ||
--- so that we can define composite formats, eg | ||
--- zero copy concatenations of arrays with mixed but | ||
--- compatible formats | ||
fromSomeAddress :: (Typeable addr, addr ~ LayoutAddress form ) => p form -> Dynamic -> Maybe addr | ||
fromSomeAddress _ x = fromDynamic x | ||
{- | ||
The purpose of this module is to illustrate | ||
and substantiate zero copy vertical and horizontal | ||
concatenation of compatibly oriented Rectilinear formats | ||
-} | ||
|
||
newtype SomeAddr = MkAddr Dynamic | ||
newtype SomeAddr = MkAddr Dynamic | ||
|
||
|
||
--- you always need to do a data wrapper | ||
--- to existentialize | ||
data SomeRectilinearFormat rnk orient where | ||
MkSomeRect :: RectilinearLayout form rnk orient => form -> SomeRectilinearFormat rnk orient | ||
|
||
|
||
newtype HetRectilinearFormat rnk orient = MkHetForm (Seq.Seq (SomeRectilinearFormat rnk orient)) | ||
-- MkHetFormat :: RectilinearLayout form rnk orient => |