Skip to content

Commit

Permalink
modernization updates and delayed cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
cartazio committed Jun 24, 2024
1 parent b98b1ba commit e355a24
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
[![Wellposed](http://www.wellposed.com/mini.png)](http://www.wellposed.com)

# Currently in Pre alpha release engineering, so nearly ready for experimental consumption
(though please dont publicize yet)
# Currently Experimental


# About Numerical-Core
This is the core Package for Numerical Haskell, a project by Carter Schonwald aka
Wellposed Ltd, and (soon I hope!) other contributors.

Numerical-Core is an open source component of the [Wellposed](http://www.wellposed.com)® Numerical Haskell software suite.

## How to use
This library is a technology demonstrator for mechanisms to simplify writing
arbitrary

##Build Status

[![Build Status](https://secure.travis-ci.org/wellposed/numerical.png?branch=master)](http://travis-ci.org/wellposed/numerical)
Expand Down
13 changes: 7 additions & 6 deletions numerical.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,16 @@ library
-- Other library packages from which modules are imported.
build-depends: base >= 4.10 && < 5

,primitive >= 0.5 && < 0.8
,primitive >= 0.5 && < 0.10
,vector >= 0.11 && < 0.13
,tagged >= 0.7 && < 0.9
,monad-ste >= 0.1 && < 0.2
,transformers >= 0.4 && < 0.6
,transformers-compat >= 0.4 && < 0.6
,ghc-prim >=0.2 && <0.10
,vector-algorithms >= 0.6.0.1 && < 0.9
,semigroups >= 0.19.1 && < 0.20
,transformers >= 0.4 && < 0.7
,transformers-compat >= 0.4 && < 0.8
,ghc-prim >=0.2 && <0.12
,vector-algorithms >= 0.6.0.1 && < 0.10
,semigroups >= 0.19.1 && < 0.21
,containers >= 0.6.7 && < 0.8
-- ,pqueue >= 1.2 && < 1.3
-- , quickcheck >=

Expand Down
8 changes: 7 additions & 1 deletion src/Numerical/Array/Layout/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,14 @@ class Layout form (rank :: Nat) | form -> rank where
basicAffineAddressShift :: (address ~ LayoutAddress form) =>
form -> address -> Int -> Maybe address

--- this operation is needed
--- so that we can define composite formats, eg
--- zero copy concatenations of arrays with mixed but
--- compatible formats
--- this needs to be in the type class
fromSomeAddress :: (Typeable addr, addr ~ LayoutAddress form ) => p form -> Dynamic -> Maybe addr
fromSomeAddress _ x = fromDynamic x



{-# MINIMAL basicToAddress, basicToIndex, basicNextAddress,basicNextIndex
,basicAddressRange,basicLogicalShape,basicCompareIndex
Expand Down
22 changes: 14 additions & 8 deletions src/Numerical/Array/Layout/Het.hs
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 =>

0 comments on commit e355a24

Please sign in to comment.