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
let langserver: ExampleLanguageServer | null = null; | |
export const activate = function() { | |
langserver = new ExampleLanguageServer(); | |
} | |
export const deactivate = function() { | |
if (langserver) { | |
langserver.stop(); | |
langserver = null; |
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
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
module Main where | |
class Monad m => Handler (g :: * -> *) (m :: * -> *) where | |
handle :: g a -> (a -> m b) -> m b | |
data Freer :: (* -> *) -> * -> * where |
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
/// ref: [zhihu](https://zhuanlan.zhihu.com/p/378252833) | |
use crate::foo::{IncreaseOnly, new_increase_only}; | |
fn main() { | |
let mut x1 = new_increase_only!(0); | |
let mut x2 = new_increase_only!(2); | |
let y = 1; | |
// only can be used in `x1` | |
let le = x1.check_less_or_equal(y).unwrap(); |
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
package org.example; | |
import com.fasterxml.jackson.annotation.JsonIgnore; | |
import com.fasterxml.jackson.annotation.JsonSubTypes; | |
import com.fasterxml.jackson.annotation.JsonTypeInfo; | |
import com.fasterxml.jackson.annotation.JsonTypeName; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import lombok.Builder; | |
import lombok.SneakyThrows; | |
import lombok.Value; |
OlderNewer