Если предыдущая версия не скомпилировалась, на хакадже, то посмотреть почему это произошло и исправить.
This file contains 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
strict digraph { | |
graph [layout=dot; overlap=false; rankdir=LR; nodesep=0.5]; | |
subgraph types { | |
node [shape=oval]; | |
Integer -> Rational [label="(%1)"]; | |
} | |
subgraph classes { | |
node [shape=square]; | |
edge [arrowhead=diamond; style=dashed]; | |
Num; |
This file contains 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
module A | |
makeEtherHasLens :: Name -> DecsQ | |
makeEtherHasLens name = do | |
TyConI dec <- reify name | |
fields <- case dec of | |
DataD _ctx _name _tvars _kind [dataCon] _derive -> case dataCon of | |
RecC _conName fs -> return $ (\(n, _bang, ty) -> (n, ty)) <$> fs | |
_ -> fail $ show name ++ ": hust have prefix constructor with named fields" | |
_ -> fail $ show name ++ ": must be one constructor record with named fields" |
This file contains 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
fn main() { | |
let s = String::from("жопа"); | |
let t : String = s.chars().skip(3).collect(); | |
println!("{}", s); | |
println!("{}", t); | |
} |
This file contains 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
fn main() { | |
let s = String::from("жопа"); | |
let t = & s[3..]; | |
println!("{}", s); | |
println!("{}", t); | |
} | |
// thread 'main' panicked at 'byte index 3 is not a char boundary; it is inside 'о' (bytes 2..4) of `жопа`', src/libcore/str/mod.rs:1771 | |
// note: Run with `RUST_BACKTRACE=1` for a backtrace. |
This file contains 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
{ | |
"form": { | |
"offer": { | |
"flights": [ | |
{ | |
"flight_segments": [ | |
{ | |
"carriers": { | |
"operating": { | |
"code": "MR", |
This file contains 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
****** Как обрабатывается запрос | |
******* Book / Book & ticket | |
******** maxPrice <- Валидируем запрос | |
********* maxPrice <- Берем ожидаемую цену из запроса | |
********* Проверяем что maxPrice > offerPrice | |
********** Ошибка | |
*********** Возвращаем прайсинг из оффера в базе | |
********* return maxPrice | |
******** newPrice <- processBooking maxPrice | |
********* pricingAcceptable maxPrice |
This file contains 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
seriousBusiness :: Trans IO Int | |
seriousBusiness = do | |
res1 <- doSomeAction | |
cleanupOnErrors res1 $ do | |
res2 <- doOtherAction | |
cleanupOnErrors res2 $ do | |
res3 <- doEvenMoreAction | |
cleanupOnErrors res3 $ do | |
return 42 |
NewerOlder