Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
openmole
openmole
Commits
56919735
Commit
56919735
authored
Jul 30, 2021
by
Romain Reuillon
Browse files
[Plugin] fix: bug in collection domain
parent
8e9e0a43
Pipeline
#1214
failed with stages
in 36 minutes and 25 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
openmole/plugins/org.openmole.plugin.domain.collection/src/main/scala/org/openmole/plugin/domain/collection/package.scala
View file @
56919735
...
...
@@ -27,7 +27,7 @@ package collection {
// Avoid clash with iterableOfToArrayIsFix when T is of type Array[T]
trait
LowPriorityImplicits
{
implicit
def
iterableIsDiscrete
[
T
]
:
DiscreteFromContextDomain
[
Iterable
[
T
]
,
T
]
=
domain
⇒
Domain
(
domain
.
iterator
)
implicit
def
iterableIsDiscrete
[
T
]
:
DiscreteFromContextDomain
[
Iterable
[
T
]
,
T
]
=
domain
⇒
Domain
(
FromContext
{
_
⇒
domain
.
iterator
}
)
implicit
def
iterableIsFix
[
T
]
:
FixDomain
[
Iterable
[
T
]
,
T
]
=
domain
⇒
Domain
(
domain
)
implicit
def
iterableIsSized
[
T
]
:
DomainSize
[
Iterable
[
T
]]
=
domain
⇒
domain
.
size
}
...
...
@@ -35,12 +35,12 @@ package collection {
package
object
collection
extends
LowPriorityImplicits
{
implicit
def
iterableOfToArrayIsFinite
[
T:
ClassTag
,
A1
[
_
]
:
ToArray
]
:
DiscreteFromContextDomain
[
Iterable
[
A1
[
T
]]
,
Array
[
T
]]
=
domain
⇒
Domain
(
domain
.
map
(
implicitly
[
ToArray
[
A1
]].
apply
[
T
]).
iterator
)
implicit
def
iterableOfToArrayIsFinite
[
T:
ClassTag
,
A1
[
_
]
:
ToArray
]
:
DiscreteFromContextDomain
[
Iterable
[
A1
[
T
]]
,
Array
[
T
]]
=
domain
⇒
Domain
(
FromContext
{
_
⇒
(
domain
.
map
(
implicitly
[
ToArray
[
A1
]].
apply
[
T
])
)
.
iterator
}
)
implicit
def
iterableOfToArrayIsFix
[
T:
ClassTag
,
A1
[
_
]
:
ToArray
]
:
FixDomain
[
Iterable
[
A1
[
T
]]
,
Array
[
T
]]
=
domain
⇒
Domain
(
domain
.
map
(
implicitly
[
ToArray
[
A1
]].
apply
[
T
]))
implicit
def
arrayIsDiscrete
[
T
]
:
DiscreteFromContextDomain
[
Array
[
T
]
,
T
]
=
domain
⇒
Domain
(
domain
.
iterator
)
implicit
def
arrayIsDiscrete
[
T
]
:
DiscreteFromContextDomain
[
Array
[
T
]
,
T
]
=
domain
⇒
Domain
(
FromContext
{
_
⇒
domain
.
iterator
}
)
implicit
def
arrayIsFix
[
T
]
:
FixDomain
[
Array
[
T
]
,
T
]
=
domain
⇒
Domain
(
domain
.
toIterable
)
implicit
def
arrayIsSized
[
T
]
:
DomainSize
[
Array
[
T
]]
=
domain
⇒
domain
.
size
implicit
def
iteratorIsDiscrete
[
T
]
:
DiscreteFromContextDomain
[
Iterator
[
T
]
,
T
]
=
domain
⇒
Domain
(
domain
)
//
implicit def iteratorIsDiscrete[T]: DiscreteFromContextDomain[Iterator[T], T] = domain ⇒ Domain(domain)
implicit
def
fromContextIteratorIsDiscrete
[
T
]
:
DiscreteFromContextDomain
[
FromContext
[
Iterator
[
T
]]
,
T
]
=
domain
⇒
Domain
(
domain
)
implicit
def
booleanValIsFactor
(
p
:
Val
[
Boolean
])
=
Factor
(
p
,
Vector
(
true
,
false
))
...
...
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