F# API Search Engine은 서명과 이름으로 F# API를 검색할 수 있는 검색 엔진입니다.
프로젝트 이름 | 개요 |
---|---|
FSharpApiSearch | 검색엔진 본체 |
FSharpApiSearch.Database | 검색 엔진 데이터베이스 작성 도구 |
FSharpApiSearch.Console | 검색 엔진 프런트 엔드 (콘솔 애플리케이션) |
릴리스 페이지에서 zip 파일을 다운로드하고 확장합니다.
먼저 FSharpApiSearch.Database.exe를 실행하여 데이터베이스를 만듭니다.
FSharpApiSearch.Database.exe
기본적으로 검색할 --lib
있는 어셈블리는 FSharp.Core
, mscorlib
, System
, System.Core
입니다. 데이터베이스를 만들 때 어셈블리를 지정할 수 있습니다. 어셈블리가 종속되는 어셈블리도 지정하십시오.
FSharpApiSearch.Database.exe --lib:TargetAssemblyDirectory TargetAssembly1 TargetAssembly2 DependentAssembly
FSharpApiSearch.Console.exe를 쿼리하지 않고 실행하면 대화식 모드로 시작됩니다. 대화식 모드를 종료하려면 #q
를 입력하십시오.
FSharpApiSearch.Console.exe
인수에 쿼리를 전달하면 한 번만 검색합니다.
FSharpApiSearch.Console.exe "int -> int"
작성한 데이터베이스를 실제로 검색에 사용하려면 --target
옵션을 사용하십시오.
FSharpApiSearch.Console.exe --target:TargetAssembly1 --target:TargetAssembly2
--target
옵션을 사용하면 기본 FSharp.Core
, mscorlib
, System
, System.Core
는 검색 대상에 포함되지 않으므로 검색 대상에 포함하고 싶은 경우는 명시적으로 지정합니다.
FSharpApiSearch.Console.exe --target:TargetAssembly1 --target:TargetAssembly2 --target:FSharp.Core --target:mscorlib --target:System --target:System.Core
respect-name-difference
옵션 respect-name-difference
옵션이 유효한 경우는 쿼리중의 다른 형태 변수나 이름 첨부 와일드 카드의 이름의 차이를 검색에 반영합니다 ?a -> ?a
a라는 쿼리는 int -> int라는 서명과 일치 ?a -> ?b
라는 쿼리는 int -> int
int -> int
와 일치하지 않습니다.
이 옵션을 사용하지 않으면 ?a -> ?b
라는 쿼리에서 int -> int
와 일치합니다.
greedy-matching
옵션 greedy-matching
옵션이 활성화되면 유형 변수와 다른 유형이 각각 일치하고 일치도가 높은 순서로 정렬되어 표시됩니다. 합니다.
ignore-param-style
옵션 함수, ignore-param-style
에는, 컬리화 형식 ( arg1 -> arg2 -> returnType
)과 튜플 형식 ( arg1 * arg2 -> returnType
)의 2 종류가 있습니다. , 컬리화 형식과 튜플 형식을 무시하고 일치합니다.
ignore-case
옵션 ignore-case
옵션이 사용 가능한 경우 API 이름, 유형 이름과 일치할 때 대소문자를 구분하지 않습니다.
substring
옵션 substring
옵션이 유효한 경우 부분 문자열로 검색합니다.
swap-order
옵션 swap-order
옵션이 유효한 경우, a -> b -> c
b -> a -> c
complement
옵션 complement
옵션 a * c
a * b * c
single-letter-as-variable
옵션 single-letter-as-variable
옵션이 유효한 경우는, 단일 문자의 형태명을 형태 변수명으로서 취급합니다. 예를 들어, t list
라고 하는 쿼리는 't list
와 같습니다.
language
옵션 쿼리, 검색 및 결과 표시를 language
옵션으로 지정한 프로그래밍 언어로 전환합니다. 이 옵션에는 F# 및 C#을 지정할 수 있습니다.
xmldoc
옵션 xmldoc
옵션이 사용 가능한 경우 검색 결과에 XML 문서를 표시합니다.
F# 쿼리는 기본적으로 F# 시그니처와 동일합니다. FSharpApiSearch 확장만 자세히 설명합니다.
>
는 FSharpApiSearch.Console.exe를 대화식 모드로 시작할 때 프롬프트입니다.
API | 쿼리 예 |
---|---|
모듈의 함수와 값 | int -> string |
레코드, 구조체 필드 | Ref<'a> -> 'a |
판별 공용체 | 'a -> Option<'a> |
회원 | 'a list -> int |
생성자 | Uri : _ Uri.new : _ Uri..ctor : _ |
이름 (함수 이름, 멤버 이름 등) | head : 'a list -> 'a head |
활성 패턴 | (||) : ... -> Expr -> ? |
형, 형 약칭, 모듈 | List<'T> |
컴퓨테이션 식 | { let! } : Async<'T> |
하위 유형 검색 | #seq<'a> -> 'a |
이름으로 검색하려면 name : signature
또는 name
으로 씁니다. 서명을 지정하지 않으면 서명 부분에 _
를 지정합니다.
> id : 'a -> 'a
Microsoft.FSharp.Core.Operators.id: 'T -> 'T, module value, FSharp.Core
> choose
Microsoft.FSharp.Collections.Array.Parallel.choose: ('T -> option<'U>) -> 'T[] -> 'U[], module value, FSharp.Core
Microsoft.FSharp.Collections.Array.choose: ('T -> option<'U>) -> 'T[] -> 'U[], module value, FSharp.Core
Microsoft.FSharp.Collections.List.choose: ('T -> option<'U>) -> list<'T> -> list<'U>, module value, FSharp.Core
Microsoft.FSharp.Collections.Seq.choose: ('T -> option<'U>) -> seq<'T> -> seq<'U>, module value, FSharp.Core
Microsoft.FSharp.Control.Event.choose: ('T -> option<'U>) -> IEvent<'Del, 'T> -> IEvent<'U>, module value, FSharp.Core
when 'Del : delegate and 'Del :> Delegate
Microsoft.FSharp.Control.Observable.choose: ('T -> option<'U>) -> IObservable<'T> -> IObservable<'U>, module value, FSharp.Core
> choose : _
Microsoft.FSharp.Collections.Array.Parallel.choose: ('T -> option<'U>) -> 'T[] -> 'U[], module value, FSharp.Core
Microsoft.FSharp.Collections.Array.choose: ('T -> option<'U>) -> 'T[] -> 'U[], module value, FSharp.Core
Microsoft.FSharp.Collections.List.choose: ('T -> option<'U>) -> list<'T> -> list<'U>, module value, FSharp.Core
Microsoft.FSharp.Collections.Seq.choose: ('T -> option<'U>) -> seq<'T> -> seq<'U>, module value, FSharp.Core
Microsoft.FSharp.Control.Event.choose: ('T -> option<'U>) -> IEvent<'Del, 'T> -> IEvent<'U>, module value, FSharp.Core
when 'Del : delegate and 'Del :> Delegate
Microsoft.FSharp.Control.Observable.choose: ('T -> option<'U>) -> IObservable<'T> -> IObservable<'U>, module value, FSharp.Core
별표( *
)를 사용하면 부분 일치 검색이 가능합니다. 예를 들어 FSharp.Core.String.* : _
는 FSharp.Core.String
모듈의 모든 API를 표시합니다.
> FSharp.Core.String.* : _
Microsoft.FSharp.Core.String.collect: (char -> string) -> string -> string, module value, FSharp.Core
Microsoft.FSharp.Core.String.concat: string -> seq<string> -> string, module value, FSharp.Core
Microsoft.FSharp.Core.String.exists: (char -> bool) -> string -> bool, module value, FSharp.Core
Microsoft.FSharp.Core.String.filter: (char -> bool) -> string -> string, module value, FSharp.Core
...
통상, 'a
등의 형태 변수와 int
등의 형태명은 매치 하지 않습니다.그러나, 어느 경우도 정리해 검색하고 싶은 경우가 있습니다.이런 경우에, 와일드 카드 ?
또는 _
를 사용할 수 있습니다.
> ? -> list<?> -> ?
Microsoft.FSharp.Collections.List.append: list<'T> -> list<'T> -> list<'T>, module value, FSharp.Core
Microsoft.FSharp.Collections.List.averageBy: ('T -> 'U) -> list<'T> -> 'U, module value, FSharp.Core
when 'U : (static member op_Addition : 'U * 'U -> 'U) and 'U : (static member DivideByInt : 'U * int -> 'U) and 'U : (static member get_Zero : unit -> 'U)
Microsoft.FSharp.Collections.List.choose: ('T -> option<'U>) -> list<'T> -> list<'U>, module value, FSharp.Core
Microsoft.FSharp.Collections.List.chunkBySize: int -> list<'T> -> list<list<'T>>, module value, FSharp.Core
...
또한 와일드카드의 이름을 지정하면 같은 ? -> ?
의 와일드카드 위치에 동일한 유형 이름이 포함되는 조건을 추가할 수 있습니다. ? -> ?
다음의 모든 함수와 일치합니다.
'a -> 'a
int -> int
'a -> int
int -> string
그러나 ?a -> ?a
같이 이름을 지정하면 위의 예에서는 'a -> int
또는 int -> string
과 일치하지 않습니다.
서브타입 검색은 지정된 기본 유형 또는 인터페이스와 호환되는 유형을 지정하는 제약 조건입니다.
쿼리에서 하위 유형 검색을 사용하려면 #type
으로 씁니다. type
부분에는 유형 이름과 인터페이스 이름을 지정할 수 있습니다.
예를 들어 ? -> #seq<'T>
는 seq<'T>
를 상속한 List<'T>
, IList<'T>
, 'T[]
등의 형식을 반환하는 함수를 검색할 수 있습니다.
인스턴스 멤버를 검색하려면 receiver -> signature
작성합니다.
메소드를 검색하려면 receiver -> arg -> returnType
작성합니다.
다중 인수의 메소드를 검색 receiver -> arg1 -> arg2 -> returnType
또는 receiver -> arg1 * arg2 -> returnType
arg1 * arg2
씁니다. ( arg1 -> arg2
)를 구별하지 않고 검색합니다. 인수 형식을 구별하여 검색하려면 ignore-param-style
옵션을 비활성화합니다.
프로퍼티를 검색하는 경우 receiver -> propertyType
receiver -> index -> propertyType
정적 멤버는 모듈의 값이나 함수와 같은 쿼리로 검색할 수 있습니다. 다인수 메서드는 인스턴스 메서드와 마찬가지로 arg1 -> arg2 -> returnType
또는 arg1 * arg2 -> returnType
이라고 씁니다.
활성 패턴을 찾으려면 (||) : (args ->) inputType -> returnType
씁니다. 부분 활성 패턴을 찾으 (|_|) : (args ->) inputType -> returnType
합니다.
inputType
부분에는 액티브 패턴으로 취급하는 형태를 지정합니다. 예를 들어, Expr
에 대한 액티브 패턴을 검색하고 싶은 경우는 (||) : ... -> Expr -> ?
args
부분에는 (||) : arg1 -> arg2 -> inputType -> returnType
의 인수를 지정합니다. 하고 싶은 경우는 (||) : inputType -> returnType
라고 씁니다. 인수의 유무를 구별하지 않고 검색하는 경우는 인수 부분에 ...
라고 하는 키워드를 이용해, (||) : ... -> inputType -> returnType
라고 씁니다.
retyrnType
의 부분에는 액티브 패턴의 실태인 함수가 돌려주는 타입을 지정 option<_>
. option<_>
, Choice<_,...,_>
?
지정하십시오. )를 사용하는 것이 좋습니다.
컴퓨테이션 표현식을 검색하려면 { syntax } : type
이라고 씁니다.
syntax
에는 let!
, yield
, yield!
, return
, return!
, use
, use!
, if/then
, for
, while
, try/with
, try/finally
및 ;
의 사용자 지정 syntax
이름 { s1; s2 } : type
지정할 수 있습니다. { s1; s2 } : type
이라고 씁니다.
C# 쿼리는 C# 시그니처와 문법이 다릅니다.
API | 쿼리 예 |
---|---|
회원 | object -> () -> string string -> int |
생성자 | Uri : _ Uri..ctor : _ |
유형 매개변수 | List<T> -> int Dictionary<tkey, tvalue> <TKey, TValue> : Dictionary<TKey, TValue> |
이름 (멤버 이름 등) | Length : string -> int Length |
금형 | List |
하위 유형 검색 | <T> : #IEnumerable<T> -> T |
멤버나 형식을 이름으로 검색하려면 name : signature
또는 name
으로 씁니다. 서명을 지정하지 않으면 서명 부분에 _
를 지정합니다.
> Length : string -> int
System.String.Length : int, instance property with get, mscorlib
> Length
int Array.Length { get; }, instance property, mscorlib
int BitArray.Length { get; set; }, instance property, mscorlib
long BufferedStream.Length { get; }, instance property, mscorlib
long FileInfo.Length { get; }, instance property, mscorlib
...
> Length : _
int Array.Length { get; }, instance property, mscorlib
int BitArray.Length { get; set; }, instance property, mscorlib
long BufferedStream.Length { get; }, instance property, mscorlib
long FileInfo.Length { get; }, instance property, mscorlib
...
별표( *
)를 사용하면 부분 일치 검색이 가능합니다. 예를 들어 System.String.* : _
은 System.String
유형의 모든 API를 표시합니다.
> System.String.* : _
System.Array.Length : int, instance property with get, mscorlib
System.Collections.BitArray.Length : int, instance property with get set, mscorlib
System.ComponentModel.DataObjectFieldAttribute.Length : int, instance property with get, System
System.ComponentModel.MaskedTextProvider.Length : int, instance property with get, System
...
유형 매개변수에 대한 설명은 세 가지가 있습니다.
형식 | 예 | 유형 매개변수 | 비고 |
---|---|---|---|
<t> : signature | <TKey, TValue> : Dictionary<TKey, TValue> | TKey , TValue | 중복 형식으로 형식 매개 변수에 대문자를 사용할 수 있습니다. |
모두 소문자 | Dictionary<tkey, tvalue> | tkey , tvalue | 모두 소문자의 경우 <T> 부분을 생략 할 수 있습니다. |
한 글자 | List<T> -> int | T | 한 문자의 경우 <T> 부분을 생략 할 수 있습니다. |
다만 모두 소문자의 경우에서도 int나 string등의 편입형은 형태 파라미터로서 취급되지 않습니다.
쿼리의 형식 매개 변수 이름은 검색할 형식 매개 변수 이름과 일치할 필요가 없습니다. 예를 들어 List<A>
라는 쿼리는 System.Collections.Generics.List<T>
형식과 일치합니다.
일반적으로, T
등의 형태 파라미터와 int
등의 형태명은 매치 하지 않습니다 ?
그러나, 어느 경우도 정리해 검색하고 싶은 경우가 있습니다.
> <T> : List<T> -> ? -> int
System.Collections.Generic.List<T>.BinarySearch(T item) : int, instance method, mscorlib
System.Collections.Generic.List<T>.FindIndex(Predicate<T> match) : int, instance method, mscorlib
System.Collections.Generic.List<T>.FindLastIndex(Predicate<T> match) : int, instance method, mscorlib
System.Collections.Generic.List<T>.IndexOf(T item) : int, instance method, mscorlib
...
또한 와일드카드의 이름을 지정하면 같은 ? -> ?
의 와일드카드 위치에 동일한 유형 이름이 포함되는 조건을 추가할 수 있습니다. ? -> ?
는 다음과 일치합니다.
static T F1<T>(T x)
static int F2 (int x)
static T F3<T>(int x)
static int F4 (string x)
그러나 ?a -> ?a
같이 이름을 지정하면 위의 예에서는 F2
또는 F4
와 일치하지 않습니다.
서브타입 검색은 지정된 기본 유형 또는 인터페이스와 호환되는 유형을 지정하는 제약 조건입니다.
쿼리에서 하위 유형 검색을 사용하려면 #type
으로 씁니다. type
부분에는 유형 이름과 인터페이스 이름을 지정할 수 있습니다.
예를 들어, <T> : ? -> #IEnumerable<T>
는 IEnumerable<T>
를 상속한 List<T>
, IList<T>
, T[]
등의 형식을 반환하는 메서드를 검색할 수 있습니다.
메소드를 검색 receiver -> (arg) -> returnType
receiver -> (arg1, arg2) -> returnType
반환값이 없는 API를 검색하고 싶은 경우는 ()
와 void
를 사용합니다.
> <T> : List<T> -> T -> int
System.Collections.Generic.List<T>.BinarySearch(T item) : int, instance method, mscorlib
System.Collections.Generic.List<T>.IndexOf(T item) : int, instance method, mscorlib
...
프로퍼티를 검색하는 경우 receiver -> propertyType
receiver -> index -> propertyType
> <T> : List<T> -> int
System.Collections.Generic.List<T>.Capacity : int, instance property with get set, mscorlib
System.Collections.Generic.List<T>.Count : int, instance property with get, mscorlib
...
메서드를 검색하려면 (arg) -> returnType
쓰고 속성을 검색하려면 propertyType
씁니다.
> string -> int
System.Convert.ToInt32(string value) : int, static method, mscorlib
System.Int32.Parse(string s) : int, static method, mscorlib
...
따라서 멤버가 속한 형식은 정적 멤버 쿼리에 설명되지 않습니다.