Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Informatik 8
CoPaR
Commits
8182aa5a
Commit
8182aa5a
authored
Jul 23, 2018
by
Hans-Peter Deifel
Browse files
Remove product functor
This was long obsoleted by the polynomial functor
parent
0f631281
Changes
2
Hide whitespace changes
Inline
Side-by-side
ma.cabal
View file @
8182aa5a
...
...
@@ -35,7 +35,6 @@ library
, MA.Functors.Bag
, MA.Functors.MonoidValued
, MA.Functors.Distribution
, MA.Functors.Product
, MA.Functors.Polynomial
, MA.Functors.SomeFunctor
, MA.Parser
...
...
src/MA/Functors/Product.hs
deleted
100644 → 0
View file @
0f631281
module
MA.Functors.Product
(
product
,
Product
(
..
)
)
where
import
Control.Monad
(
void
)
import
Prelude
hiding
(
product
)
import
Data.Tuple.Extra
(
both
)
import
MA.RefinementInterface
import
qualified
MA.Parser.Lexer
as
L
import
MA.FunctorExpression.Parser
import
MA.Coalgebra.RefinementTypes
import
MA.Coalgebra.Parser
data
Product
a
=
Product
a
a
deriving
(
Show
,
Functor
,
Foldable
,
Traversable
)
product
::
FunctorParser
Product
product
=
infixR
$
do
void
$
L
.
symbol
"×"
return
Product
data
Side
=
L
|
R
deriving
(
Eq
)
data
Three
=
ToRest
|
ToCompound
|
ToSub
deriving
(
Show
,
Eq
,
Ord
,
Enum
)
type
instance
H1
Product
=
()
type
instance
H3
Product
=
(
Three
,
Three
)
type
instance
Label
Product
=
Side
type
instance
Weight
Product
=
(
Bool
,
Bool
)
instance
ParseMorphism
Product
where
parseMorphismPoint
(
Product
parseLeft
parseRight
)
=
L
.
parens
$
do
left
<-
parseLeft
void
L
.
comma
right
<-
parseRight
return
(
()
,
[(
left
,
L
),
(
right
,
R
)])
instance
RefinementInterface
Product
where
init
::
H1
Product
->
[
Label
Product
]
->
Weight
Product
init
_
_
=
(
True
,
True
)
update
::
[
Label
Product
]
->
Weight
Product
->
(
Weight
Product
,
H3
Product
,
Weight
Product
)
update
labels
(
left
,
right
)
=
val
up
where
val
h3
=
(
both
(
==
ToSub
)
h3
,
h3
,
both
(
==
ToCompound
)
h3
)
up
=
(
left
+?
(
L
`
elem
`
labels
),
right
+?
(
R
`
elem
`
labels
))
(
+?
)
::
Bool
->
Bool
->
Three
a
+?
b
=
toEnum
(
fromEnum
a
+
fromEnum
b
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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