duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
// This is free and unencumbered software released into the public domain. | |
// | |
// Anyone is free to copy, modify, publish, use, compile, sell, or | |
// distribute this software, either in source code form or as a compiled | |
// binary, for any purpose, commercial or non-commercial, and by any | |
// means. | |
// | |
// In jurisdictions that recognize copyright laws, the author or authors | |
// of this software dedicate any and all copyright interest in the | |
// software to the public domain. We make this dedication for the benefit |
;;; This is one of the example programs from the textbook: | |
;;; | |
;;; Artificial Intelligence: | |
;;; Structures and strategies for complex problem solving | |
;;; | |
;;; by George F. Luger and William A. Stubblefield | |
;;; | |
;;; These programs are copyrighted by Benjamin/Cummings Publishers. | |
;;; | |
;;; We offer them for use, free of charge, for educational purposes only. |
Now being developed at https://github.com/pao/Monads.jl and available from Pkg as "Monads".
Full documentation is available at https://monadsjl.rtfd.org/.
module Monads
# types
export Monad, Identity, MList, Maybe, State
# combinators
Miles Sabin implemented a nice selection sort example in Scala's type system. See:
http://www.chuusai.com/2012/01/27/type-level-sorting-in-shapeless/
To get a better understanding how that works I ported the algorithm to Prolog.
selectleast([H|T], TM, [H|TRem]):-
selectleast(T, TM, TRem), TM < H.
selectleast([H|T], H, T).