Comments (4)
Scalaz6 overloads the meaning of Zero a bit: it's both the Zero of the corresponding Monoid (ie, x + 0 = x), and this gets (ab--)used as a default value. Neither of these types forms a Monoid, so it's hard to add a reasonable Zero. It's likely that in Scalaz7 we will separate these better.
For now, I think it's more appropriate to add these to your own project. Just declare the implicits and import them; or declare them in your top level package object to avoid needing an import.
from scalaz.
Thanks @retronym, your suggestion sounds very sensible. I've tried adding the following to the package def:
// For ∅[java.util.UUID]
implicit def UUIDZero: Zero[UUID] = zero(null)
But I'm getting could not find implicit value for parameter z: scalaz.Zero[java.util.UUID]
errors when I call it - any ideas what I'm doing wrong?
from scalaz.
Did you import it at the place you need it?
Try this at the place you want to use it:
(UUIDZero: Zero[UUID])
from scalaz.
Thanks @retronym, I didn't import it at the place of use because it's in the package definition. However it doesn't work either if I put the implicit def right next to the calling code :
implicit def UUIDZero: Zero[UUID] = zero(null)
def this() = this(∅[Long], ∅[UUID]) // Still throws error
I didn't understand where I should add the snippet in your last message? (UUIDZero: Zero[UUID]
- any ideas much appreciated!
from scalaz.
Related Issues (20)
- Scala 2.13 regression in EitherT instances (using 7.2.27) HOT 8
- Support LazyList for Scala 2.13 HOT 3
- scalaz.github.io is empty. There is no documentation. HOT 1
- Free, FreeAp and FreeT instances if Scala 2.13 or higher
- Publish for Scala.js 1.0-RC2 HOT 1
- Scala's for-yield doesn't work for Monad with high Generic HOT 3
- Comparing Trees HOT 1
- release 7.3.0 final HOT 1
- scalafix rule for scalaz 7.2 => 7.3 HOT 1
- Apply instance/syntax for Function1 HOT 2
- Reducer instance in Apply makes function unserializable HOT 1
- Scaladoc generation failing on .liftM[OptionT] in scalaz 7.3.1
- Trouble with Apply on Kleisli HOT 4
- Running sequence with Free monad HOT 1
- libera.chat link does not work
- avoid `scala.App` in example
- ReactiveX operators for StreamT HOT 1
- Shall we remove the mandatory Trampoline from Cofree?
- Improving StreamT HOT 5
- Dequeues aren't amortized O(1) when using both `unsnoc` and `uncons` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalaz.