Note: Tested on Fedora only
- Download the new release of GraalVM and unpack it anywhere in your filesystem:
$ tar -xvzf graalvm-ce-1.0.0-rc14-linux-amd64.tar.gz
Note: Tested on Fedora only
$ tar -xvzf graalvm-ce-1.0.0-rc14-linux-amd64.tar.gz
| package org.apache.lucene.util; | |
| import java.lang.reflect.Constructor; | |
| import java.lang.reflect.UndeclaredThrowableException; | |
| public final class AttributeFactoryHelpers { | |
| static final AttributeFactory DEFAULT = new DefaultAttributeFactory(); | |
| static final Constructor<? extends AttributeImpl> findAttributeImplCtor(Class<? extends AttributeImpl> clazz) { | |
| try { |
| let addChild updateNode addNode value parent = | |
| match withNewChild value parent with | |
| | None -> async.Return None | |
| | Some (newParent, child) as path -> | |
| async { do! addNode child | |
| do! updateNode newParent | |
| return Some child } | |
| let addChildById getNode updateNode addNode logAction value parentId = | |
| async { let! parent = getNode parentId |
| $remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '" | |
| $found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; | |
| if( $found ){ | |
| $remoteport = $matches[0]; | |
| } else{ | |
| echo "The Script Exited, the ip address of WSL 2 cannot be found"; | |
| exit; | |
| } |
| module RResult = | |
| open System.Collections.Generic | |
| open System.Text | |
| [<RequireQualifiedAccess>] | |
| type RBad = | |
| | Message of string | |
| | Exception of exn | |
| | Object of obj | |
| | DescribedObject of string*obj |
Full source: https://gist.github.com/mrange/aa9e0898492b6d384dd839bc4a2f96a1
Option<_> is great for ROP (Railway Oriented Programming) but we get no info on what went wrong (the failure value is None which carries no info).
With the introduction F# 4.1 we got Result<_, _> a "smarter" Option<_> as it allows us to pass a failure value.
However, when one inspects the signature of Result.bind one sees a potential issue for ROP:
| // <copyright file="CustomClaimsPrincipalFactory.cs" company=""> | |
| // Copyright (c) | |
| // </copyright> | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Security.Claims; | |
| using System.Threading.Tasks; | |
| using Platform.Business.Interfaces; | |
| using Platform.Domain.Entities; |
| [assembly: OwinStartup(typeof(Startup))] | |
| namespace Api | |
| { | |
| public class Startup | |
| { | |
| public void Configuration(IAppBuilder app) | |
| { | |
| var config = new HttpConfiguration(); |
| public IServiceProvider ConfigureServices(IServiceCollection services) | |
| { | |
| // Configure regular ASP.NET Core services | |
| services.AddMvc(); | |
| // ... | |
| // Send configuration to Castle Windsor | |
| Container.Populate(services); | |
| Container.BeginScope(); | |
| return Container.Resolve<IServiceProvider>(); |
| # Ruby is our language as asciidoctor is a ruby gem. | |
| lang: ruby | |
| before_install: | |
| - sudo apt-get install pandoc | |
| - gem install asciidoctor | |
| script: | |
| - make | |
| after_success: | |
| - .travis/push.sh | |
| env: |