Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
dph
Commits
daf2f21e
Commit
daf2f21e
authored
Jul 11, 2007
by
rl@cse.unsw.edu.au
Browse files
Temporarily add PA instance for tuples
parent
4d5b1bf7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Data/Array/Parallel/Lifted/Tuple.hs
0 → 100644
View file @
daf2f21e
module
Data.Array.Parallel.Lifted.Tuple
where
import
Data.Array.Parallel.Lifted.PArray
data
instance
PArray
()
=
PUnit
!
Int
()
instance
PA
()
where
{-# INLINE lengthPA #-}
lengthPA
(
PUnit
n
_
)
=
n
{-# INLINE replicatePA #-}
replicatePA
n
x
=
PUnit
n
x
-- Tuples
--
data
STup2
a
b
=
STup2
!
a
!
b
data
STup3
a
b
c
=
STup3
!
a
!
b
!
c
data
STup4
a
b
c
d
=
STup4
!
a
!
b
!
c
!
d
data
STup5
a
b
c
d
e
=
STup5
!
a
!
b
!
c
!
d
!
e
data
instance
PArray
(
a
,
b
)
=
PTup2
!
Int
(
STup2
(
PArray
a
)
(
PArray
b
))
instance
(
PA
a
,
PA
b
)
=>
PA
(
a
,
b
)
where
{-# INLINE lengthPA #-}
lengthPA
(
PTup2
n
_
)
=
n
{-# INLINE replicatePA #-}
replicatePA
n
p
=
PTup2
n
(
case
p
of
{
(
a
,
b
)
->
STup2
(
replicatePA
n
a
)
(
replicatePA
n
b
)})
data
instance
PArray
(
a
,
b
,
c
)
=
PTup3
!
Int
(
STup3
(
PArray
a
)
(
PArray
b
)
(
PArray
c
))
instance
(
PA
a
,
PA
b
,
PA
c
)
=>
PA
(
a
,
b
,
c
)
where
{-# INLINE lengthPA #-}
lengthPA
(
PTup3
n
_
)
=
n
{-# INLINE replicatePA #-}
replicatePA
n
p
=
PTup3
n
(
case
p
of
{
(
a
,
b
,
c
)
->
STup3
(
replicatePA
n
a
)
(
replicatePA
n
b
)
(
replicatePA
n
c
)})
ndp.cabal
View file @
daf2f21e
...
...
@@ -70,6 +70,7 @@ other-modules:
Data.Array.Parallel.Unlifted.Parallel.Segmented
Data.Array.Parallel.Lifted.PArray
Data.Array.Parallel.Lifted.Closure
Data.Array.Parallel.Lifted.Tuple
ghc-options: -fglasgow-exts -fbang-patterns -O2 -funbox-strict-fields
-fliberate-case-threshold100 -fdicts-cheap -fno-method-sharing
-fmax-simplifier-iterations6 -threaded -haddock -ftype-families
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment