- About the (simple) exercise
- Higher Order Functions
- Throwing exceptions: here be dragons!!
- Sentinel values: better but not great
- The
Option
: error as an ADT - Functional combinators: add some sugar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main extends App { | |
RatpackServer.start { spec => | |
spec.serverConfig(c => c.env()) | |
.registry(Guice.registry(g => g.bind(classOf[VersionHandler]))) | |
.handlers(chain => chain.get("version", classOf[VersionHandler])) | |
} | |
} | |
case class VersionConfig(@BeanProperty appName: String, @BeanProperty appVersion: String) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================================================================================ | |
Available Java Versions | |
================================================================================ | |
Vendor | Current | Version | Status | Identifier | |
-------------------------------------------------------------------------------- | |
AdoptOpenJDK | | 12.0.1.j9 | available | 12.0.1.j9-adpt | |
| >>> | 12.0.1.hs | available | 12.0.1.hs-adpt | |
| | 11.0.3.j9 | installed | 11.0.3.j9-adpt | |
| | 11.0.3.hs | available | 11.0.3.hs-adpt | |
| | 8.0.212 | available | 8.0.212-adpt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ForST private constructor() { | |
companion object | |
} | |
typealias STOf<S, A> = arrow.Kind2<ForST, S, A> | |
typealias STPartialOf<S> = arrow.Kind<ForST, S> | |
@Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE") | |
inline fun <S, A> STOf<S, A>.fix(): ST<S, A> = this as ST<S, A> |
OlderNewer